Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

remove border-collapse style from ASP.NET DataList

I'm a newbie at ASP.NET and am having trouble styling a DataList. I've lately become enamored with rounded corners on borders and am trying to use the effect on all of my pages by applying it to all HTML tags. On Internet Explorer, the border on my DataList looks terrible because I see rounded corners around each element of my DataList rather than just the four corners of the outer box border.

I tracked this down to the fact that ASP.NET is adding:

style="collapse-border:collapse"

to the tag that begins my DataList in the rendered HTML. If this style rule is not present, the border looks exactly as I intended.

I don't know how to eliminate the border-collapse style from what ASP.NET generates. I don't see it present in the Visual Web Developer IDE or in the properties for the DataList. I can't seem to override it in a style sheet either. Does the style attribute on a tag trump all other rules? Can anyone suggest how I can get ASP.NET to not generate the border-collapse style?

like image 489
John Avatar asked Feb 21 '23 12:02

John


1 Answers

A DataList renders the border-collapse: collapse; style when its CellSpacing property is set to 0 (the default). To remove the style, set CellSpacing to -1.

like image 163
Michael Liu Avatar answered Mar 03 '23 20:03

Michael Liu