I came across two issues with Microsoft applications while trying to eliminating vertical cell borders in HTML tables using CSS.
GridView and border-collapse
ASP.Net 2.0’s GridView always emits something like the following:
Turns out GridView is hardcoded to emit the style attribute and there is no way to override the behavior in layout [reference, reference].
There is no way to remove the extra attribute, but I found a workaround [reference] that results in something like this:
IE and empty-cells
Internet Explorer 7 does not support empty-cells [reference]. Confirmed it.
So Simple It Hurts
In the end I achieved the desired table formatting without having to worry about border-collapse or empty-cells. All I needed was something like this:
td { border-width: 0px 1px 0px 0px; }
Posted by Brent on September 10, 2008 at 14:40
Another way to do it is to override the style using the ! important keyword(s) in your own CSS class. I explain how here: http://justgeeks.blogspot.com/2008/09/override-any-css-style-even-inline.html. I’m not sure which solution I like better though. Hmmm….
Posted by tibx on November 24, 2008 at 16:38
try GridLines=”None” CellSpacing=”-1″