Hi all, I have some strange problem with table in Firefox.
What I want to create is to create a grid and think border.
Here is the mock up (thanks inkscape).
Here is my code:
<style>
.mytable { border-collapse: collapse; }
.mytd {
width : 1.3em;
border : 1px solid black;
padding : 0px;
margin : 0px;
text-align : center;
}
.mytd-top { border-top: 3px solid black; }
.mytd-bottom { border-bottom: 3px solid black; }
.mytd-left { border-left: 3px solid black; }
.mytd-right { border-right: 3px solid black; }
</style>
<table class="mytable">
<tr><td class="mytd mytd-top mytd-left">1</td><td class="mytd mytd-top" >2</td><td class="mytd mytd-top mytd-right">3</td></tr>
<tr><td class="mytd mytd-left">4</td><td class="mytd" >5</td><td class="mytd mytd-right">6</td></tr>
<tr><td class="mytd mytd-bottom mytd-left">7</td><td class="mytd mytd-bottom">8</td><td class="mytd mytd-bottom mytd-right">9</td></tr>
</table>
The above code should give me what I want but it does not. There seems to be problem with border left and right when border-colllapse
is colllapse
.
The above mode get me:
No outer border!!!
Notice there are three lines in bold.
The problem seems to be only to left and right and NOT top and bottom.
If the three lines are:
.mytable { border-collapse: collapse; }
.mytd-left { }
.mytd-right { }
I get:
No problem for top and bottom.
If the three lines are:
.mytable { border-collapse: collapse; }
.mytd-left { border-left: 3px solid black; }
.mytd-right { }
I get:
The problem seems to be isolate left and right.
If the three lines are:
.mytable { }
.mytd-left { border-left: 3px solid black; }
.mytd-right { border-right: 3px solid black; }
I get:
Without collapse
all border shows as expected.
What is going on here?
Is there a work around? a replacement for collapse
?
I only target FF (internal project) so I don't really care if it work in other browser or not.
Thanks in advance.