DataList and border-collapse
-
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.
-
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.
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 -
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 KlausThanks, 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.
-
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.