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. Web Development
  3. ASP.NET
  4. DataList and border-collapse

DataList and border-collapse

Scheduled Pinned Locked Moved ASP.NET
questionhtmlcsharpjavascriptasp-net
4 Posts 2 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.
  • R Offline
    R Offline
    RX Maverick
    wrote on last edited by
    #1

    I am using a datalist to easily display my data in 7 columns, but I can't seem to get the alignment correct. After a few tries i opened up the HTML and found border-collapse:collapse in the table's style. I used IE7s DevToolBar DOM viewer to remove it on the fly and everything looks and works great. So now my question is how do I get ASP.NET not to add it? I have tried using a CssClass, but the class option gets overwrote by the inline one. I also have tried to remove it after the fact with a little JavaScript (document.GetElementByID("elementID").style="" or document.GetElementByID("elementID").style.border-collapse="") both don't work. Thanks for any help.

    K 1 Reply Last reply
    0
    • R RX Maverick

      I am using a datalist to easily display my data in 7 columns, but I can't seem to get the alignment correct. After a few tries i opened up the HTML and found border-collapse:collapse in the table's style. I used IE7s DevToolBar DOM viewer to remove it on the fly and everything looks and works great. So now my question is how do I get ASP.NET not to add it? I have tried using a CssClass, but the class option gets overwrote by the inline one. I also have tried to remove it after the fact with a little JavaScript (document.GetElementByID("elementID").style="" or document.GetElementByID("elementID").style.border-collapse="") both don't work. Thanks for any help.

      K Offline
      K Offline
      klawipo
      wrote on last edited by
      #2

      Did you try the CellSpacing property? Setting it to a positive value should remove the border-collapse style. By the way, your javacript code is slightly wrong, try this: document.**getElementById**("elementID").style.**borderCollapse**="" But before doing such javascript stuff better try playing around with the border-related members of the DataList class. Hope that helps Klaus

      R 1 Reply Last reply
      0
      • K klawipo

        Did you try the CellSpacing property? Setting it to a positive value should remove the border-collapse style. By the way, your javacript code is slightly wrong, try this: document.**getElementById**("elementID").style.**borderCollapse**="" But before doing such javascript stuff better try playing around with the border-related members of the DataList class. Hope that helps Klaus

        R Offline
        R Offline
        RX Maverick
        wrote on last edited by
        #3

        Thanks, I've played with all the spacing and cell properties but none just remove the collapse (normally they added extra space I didn't want). Thanks for the javascript correction, I hate when javascript and CSS use different property names.

        K 1 Reply Last reply
        0
        • R RX Maverick

          Thanks, I've played with all the spacing and cell properties but none just remove the collapse (normally they added extra space I didn't want). Thanks for the javascript correction, I hate when javascript and CSS use different property names.

          K Offline
          K Offline
          klawipo
          wrote on last edited by
          #4

          The exact effects of the ASP Class members to html output is poorly ducumented. Perhaps I'll find sth more exactly on google. I'll let you know. Good Luck Klaus

          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