Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Making bordercolor work in FireFox / Mozilla (See related posts)

IE and Safari support the bordercolor attribute directly on TABLE elements which colors the external and internal borders. FireFox does not, but you can use standard CSS to fix it.

TABLE { border: 1px solid #eee; }
TABLE TD { border: 1px solid #eee; }


Unlike most solutions, this also correctly changes the color of the cell borders.

Comments on this post

bennettpr posts on Mar 16, 2006 at 21:27
why not just this:

/* same rule, applied to two elements */
table, table td {border: solid 1px #eee;}
bennettpr posts on Mar 16, 2006 at 21:28
tidier:
/* same rule, applied to two elements */
table, table td {border: solid 1px #eee;}
Pyrofyr posts on Feb 05, 2007 at 21:05
This is pretty old, but I need to know if there is a way to make it only apply to a certain table, as it's not working for me in a separate CSS document, as the layout of the website I am fixing is created almost totally in tables, so when I try to use this rule, it applies to the whole website. Is the only other way to add it straight to the code?
pwlin posts on Feb 06, 2007 at 06:51
Pyrofyr:

Define an ID for your table:
css:
#mytable1, #mytable1 td {border: 1px solid #eee;}

html:
<table id="mytable1">
<tr><td>content</td></tr>
</table>


You need to create an account or log in to post comments to this site.


Click here to browse all 5140 code snippets

Related Posts