Cascading Style Sheets (CSS) are very nice for formatting HTML. In general, I think it is a very bad idea for an ASP.NET control to emit inline styles because it prevents the developer from overriding the formatting. This is of course unless there is a corresponding property or programmatic way provided of changing it.
The ASP.NET GridView is a great example of this. It emits the following inline style for the table tag it emits.
style="border-collapse:collapse"
If I want to change that *they* provide no way to do so.
However, CSS does provide a way to that I recently found here http://home.tampabay.rr.com/bmerkey/cheatsheet.htm.
So, all I have to do is create a CSS class called something like GridViewStyle by including the following between the head tags on the .aspx page.
<style>
.GridViewStyle { border-collapse:separate ! important; }
</style>
This is the key to this entire solution. Notice the ! important; This means that border-collapse will be set to separate even if the inline style says differently. This is *very* powerful.
To apply this CSS class to the table tag that is emitted by the GridView all we have to do is set the CssClass property of the GridView to GridViewStyle.