Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. Site Bugs / Suggestions
  4. Code wrap design looked sucks

Code wrap design looked sucks

Scheduled Pinned Locked Moved Site Bugs / Suggestions
comdesign
14 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    wseng
    wrote on last edited by
    #1

    After the code wrap with code tag, the code format looked sucked.It is not easily to read. https://i.imgur.com/1VVLI8K.png[^]

    OriginalGriffO 1 Reply Last reply
    0
    • W wseng

      After the code wrap with code tag, the code format looked sucked.It is not easily to read. https://i.imgur.com/1VVLI8K.png[^]

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #2

      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 use pre tags <pre>lump of code</pre> (via the code 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 have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      W 1 Reply Last reply
      0
      • OriginalGriffO OriginalGriff

        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 use pre tags <pre>lump of code</pre> (via the code 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:
            ///
        
        W Offline
        W Offline
        wseng
        wrote on last edited by
        #3

        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.

        OriginalGriffO 1 Reply Last reply
        0
        • W wseng

          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.

          OriginalGriffO Offline
          OriginalGriffO Offline
          OriginalGriff
          wrote on last edited by
          #4

          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!

          "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
          "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

          W 1 Reply Last reply
          0
          • OriginalGriffO OriginalGriff

            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!

            W Offline
            W Offline
            wseng
            wrote on last edited by
            #5

            This is from my view https://i.imgur.com/EzNXZey.png[^]

            OriginalGriffO 1 Reply Last reply
            0
            • W wseng

              This is from my view https://i.imgur.com/EzNXZey.png[^]

              OriginalGriffO Offline
              OriginalGriffO Offline
              OriginalGriff
              wrote on last edited by
              #6

              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!

              "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
              "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

              W 1 Reply Last reply
              0
              • OriginalGriffO OriginalGriff

                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!

                W Offline
                W Offline
                wseng
                wrote on last edited by
                #7

                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 ?

                OriginalGriffO 1 Reply Last reply
                0
                • W wseng

                  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 ?

                  OriginalGriffO Offline
                  OriginalGriffO Offline
                  OriginalGriff
                  wrote on last edited by
                  #8

                  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 no idea what I did, but I'm taking full credit for it." - ThisOldTony
                  "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                  W 1 Reply Last reply
                  0
                  • OriginalGriffO OriginalGriff

                    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!

                    W Offline
                    W Offline
                    wseng
                    wrote on last edited by
                    #9

                    I have updated Chrome version to the latest but the issue still there. Perhaps this issue only happened to Linux's users ?

                    OriginalGriffO L 3 Replies Last reply
                    0
                    • W wseng

                      I have updated Chrome version to the latest but the issue still there. Perhaps this issue only happened to Linux's users ?

                      OriginalGriffO Offline
                      OriginalGriffO Offline
                      OriginalGriff
                      wrote on last edited by
                      #10

                      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 no idea what I did, but I'm taking full credit for it." - ThisOldTony
                      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                      W 1 Reply Last reply
                      0
                      • W wseng

                        I have updated Chrome version to the latest but the issue still there. Perhaps this issue only happened to Linux's users ?

                        OriginalGriffO Offline
                        OriginalGriffO Offline
                        OriginalGriff
                        wrote on last edited by
                        #11

                        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!

                        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                        "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                        1 Reply Last reply
                        0
                        • OriginalGriffO OriginalGriff

                          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!

                          W Offline
                          W Offline
                          wseng
                          wrote on last edited by
                          #12

                          Ubuntu 18.04.1 LTS OS type 64-bit

                          1 Reply Last reply
                          0
                          • W wseng

                            I have updated Chrome version to the latest but the issue still there. Perhaps this issue only happened to Linux's users ?

                            L Offline
                            L Offline
                            Lost User
                            wrote on last edited by
                            #13

                            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.

                            W 1 Reply Last reply
                            0
                            • L Lost User

                              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.

                              W Offline
                              W Offline
                              wseng
                              wrote on last edited by
                              #14

                              really strange

                              1 Reply Last reply
                              0
                              Reply
                              • Reply as topic
                              Log in to reply
                              • Oldest to Newest
                              • Newest to Oldest
                              • Most Votes


                              • Login

                              • Don't have an account? Register

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • World
                              • Users
                              • Groups