Code wrap design looked sucks
-
After the code wrap with code tag, the code format looked sucked.It is not easily to read. https://i.imgur.com/1VVLI8K.png[^]
That's because
code
tags: <code>code</code> are meant for inline highlighting - variable names and such like. If you use it for actual code then it looks very poor:/// <summary> /// Converts a List to a DataTable by converting each public property to /// a DataColumn /// </summary> /// <remarks> /// To stop a column becoming part of the DataTable, set it's Browsable /// attribute to false: /// [Browsable(false)] /// public TrackStatus Status { get; set; } /// </remarks> /// <typeparam name="T"></typeparam> /// <param name="data"></param> /// <returns></returns> public static DataTable ToDataTable<T>(this IList<T> data) { PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(typeof(T)); bool[] visibility = new bool[properties.Count]; DataTable dt = new DataTable(); for (int i = 0; i < properties.Count; i++) { PropertyDescriptor property = properties[i]; AttributeCollection ac = property.Attributes; visibility[i] = true; if (ac.Contains(BrowsableAttribute.No)) { visibility[i] = false; continue; } dt.Columns.Add(property.Name, property.PropertyType); } foreach (T item in data) { List<object> values = new List<object>(); for (int i = 0; i < properties.Count; i++) { if (visibility[i]) { values.Add(properties[i].GetValue(item)); } } dt.Rows.Add(values.ToArray()); } return dt; }
If you usepre
tags <pre>lump of code</pre> (via thecode
widget):/// <summary> /// Converts a List to a DataTable by converting each public property to /// a DataColumn /// </summary> /// <remarks> /// To stop a column becoming part of the DataTable, set it's Browsable /// attribute to false: ///
-
That's because
code
tags: <code>code</code> are meant for inline highlighting - variable names and such like. If you use it for actual code then it looks very poor:/// <summary> /// Converts a List to a DataTable by converting each public property to /// a DataColumn /// </summary> /// <remarks> /// To stop a column becoming part of the DataTable, set it's Browsable /// attribute to false: /// [Browsable(false)] /// public TrackStatus Status { get; set; } /// </remarks> /// <typeparam name="T"></typeparam> /// <param name="data"></param> /// <returns></returns> public static DataTable ToDataTable<T>(this IList<T> data) { PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(typeof(T)); bool[] visibility = new bool[properties.Count]; DataTable dt = new DataTable(); for (int i = 0; i < properties.Count; i++) { PropertyDescriptor property = properties[i]; AttributeCollection ac = property.Attributes; visibility[i] = true; if (ac.Contains(BrowsableAttribute.No)) { visibility[i] = false; continue; } dt.Columns.Add(property.Name, property.PropertyType); } foreach (T item in data) { List<object> values = new List<object>(); for (int i = 0; i < properties.Count; i++) { if (visibility[i]) { values.Add(properties[i].GetValue(item)); } } dt.Rows.Add(values.ToArray()); } return dt; }
If you usepre
tags <pre>lump of code</pre> (via thecode
widget):/// <summary> /// Converts a List to a DataTable by converting each public property to /// a DataColumn /// </summary> /// <remarks> /// To stop a column becoming part of the DataTable, set it's Browsable /// attribute to false: ///
-
I use pre tags, but the code still not easy to read. There are no space between each line.Previously it had, but now no.
It does with mine - where is the "bad example" posted: can you give us a URL to the message or question?
Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
-
It does with mine - where is the "bad example" posted: can you give us a URL to the message or question?
Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
-
This is from my view https://i.imgur.com/EzNXZey.png[^]
That's your forum settings: Look above the messages on this page, and you will see an Orange bar below the "New Discussion" button. Check your "Spacing" setting: I'm guessing you have "Tight", and want "Compact". Change that, and click the "Update" button on the right hand end of the bar.
Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
-
That's your forum settings: Look above the messages on this page, and you will see an Orange bar below the "New Discussion" button. Check your "Spacing" setting: I'm guessing you have "Tight", and want "Compact". Change that, and click the "Update" button on the right hand end of the bar.
Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
-
The output still same. Here the question from quick answer section How do I show my edit data in a js modal[^] From my view [^] Does this look the same as yours ?
Nope:
I see you are running Chrome, but an older version. I'm on Version 71.0.3578.98 (Official Build) (64-bit), under Windows 10. That looks like Android you are using (or maybe Chromebook?) - though not sure which version. If I look at it on my Nexus 7 (Android V4.4) it's fine as well. It looks good on my Android phone as well (if hard to read because of the small screen) I'd suspect fonts myself - my desktop is showing the code font as
font: 9pt Consolas,"Courier New",Courier,mono;
- what do you see when you inspect the page?Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
-
Nope:
I see you are running Chrome, but an older version. I'm on Version 71.0.3578.98 (Official Build) (64-bit), under Windows 10. That looks like Android you are using (or maybe Chromebook?) - though not sure which version. If I look at it on my Nexus 7 (Android V4.4) it's fine as well. It looks good on my Android phone as well (if hard to read because of the small screen) I'd suspect fonts myself - my desktop is showing the code font as
font: 9pt Consolas,"Courier New",Courier,mono;
- what do you see when you inspect the page?Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
-
I have updated Chrome version to the latest but the issue still there. Perhaps this issue only happened to Linux's users ?
So Chris can look at it, it might help if you post your system details?
Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
-
I have updated Chrome version to the latest but the issue still there. Perhaps this issue only happened to Linux's users ?
It's possible!
Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
-
So Chris can look at it, it might help if you post your system details?
Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
-
I have updated Chrome version to the latest but the issue still there. Perhaps this issue only happened to Linux's users ?
-
I am posting this message from Chromium browser on Ubuntu 16. The layout of code blocks looks just the same as on Windows. There must be something specific to your setup that is causing it.