I have an html table within a div of a specific size. I want the table to apply margin collapse and be 100% wide. Here is my code. It renders how I want it to in IE8 and incorrectly in Firefox. Firefox may be doing the spec correctly, but whatever. How do I fix my css to work in both browsers?
Untitled 1table
{
border-collapse: collapse;
border-spacing: 0;
}
table
{
margin: 10px 0;
width: 100%;
display: block;
}
p
{
margin: 10px 0;
}
td, th
{
border: 1px solid #000000;
}
Some text at the top. Notice that the margin collapse does not work unless display:block.
Header 1 | Header 2 | Header 3 | |
---|---|---|---|
Label 1 | 1.A | 1.B | 1.c |
Label 2 | 2.A | 2.B | 2.c |
Some text at the bottom. Notice that the margin collapse does not work unless display:block. Its stupid.
I need the display:block for margin collapsing to work in Firefox. If you remove the display:block, you should notice that the spacing between the
tags widens from 10px to 20px.
This is also an edit to this question that I posted earlier, but it won't let me edit for some reason. I've been messing around with my internet cache so I probably messed up a cookie.