I created an HTML table and used the following CSS to style the border as I wanted:
-
The top row and column are to be one color, and the rest of the table is to be stripes alternative row colors.
-
Regular single black border over each cell
Here is my CSS:
#functionMatrixTable td
{
border-collapse: collapse;
border-width: 1px;
border-color: Black;
border-style: solid;
}
#functionMatrixTable th
{
border-collapse: collapse;
border-width: 1px;
border-color: Black;
border-style: solid;
}
#functionMatrixTable tbody tr.odd th, tbody tr.even th {
background-color: #D8D8D8;
}
#functionMatrixTable tr.odd td{
background-color: #ffffff;
padding: 4px;
}
#functionMatrixTable tr.even td {
background-color: #CDE0F6;
padding: 4px;
}
#functionMatrixTable th
{
padding: 4px;
background-color: #D8D8D8;
color: #787878;
}
The strange issue in Firefox is that it seems to put a border around half of my table but not the rest. Here is an example image. It looks fine in IE8. any ideas what i am doing wrong here?
Screenshot of my HTML table in Firefox. When I click in a cell the border appears. Why?
alt text http://img40.imageshack.us/img40/5126/htmltable.png
I think you have a bug somewhere in the code that generates your HTML, based on that screen-shot, I would say that your table HTML is malformed. Also, the sample CSS you provided seems incomplete.
I just tried the following sample (with some CSS modifications), and it rendered a table correctly in firefox with borders around all the elements (sorry, I can’t test this in IE):
If your table is static HTML, then something like the above should render in Firefox with no problems. If you’re rendering the table on the fly, then the method you’re using is most likely not compatible with Firefox. Are you using javascript maybe?