CSS for No Border Thickness
I have a table that I built out with 0px
border, and I am trying to get images in each row to fit seamlessly to one another but even though the border does not show there is still a 1px
gap in between the rows. Is there a way to fix this?
table {
border-collapse: collapse;
border-spacing: 0px;
font-size: 10px;
}
table th, table td {
padding: 0px;
margin: 0px;
border-width: 0px;
}
tr {
padding: 0px;
ma开发者_StackOverflow社区rgin: 0px;
border-collapse: collapse;
border-spacing: 0px;
}
Might be that the content inside the table is creating some extra space, and you didn't mention what browser, but be aware that IE7 doesn't understand border-collapse so you should add:
<table cellspacing="0">
to the table for IE7. Also, there is no reason to apply border-collapse
to the tr.
I think border-spacing
is for a table. Did you try border: none
for the tr
element?
Try this:
CSS
img {
border:none;
padding:0;
margin:0;
}
HTML
<table style="text-align: left; width: 100%;" border="0" cellpadding="0" cellspacing="0">
..table rows..
</table>
did you try display: block
for images?
Thanks for the responses, I had the cellspacing="0" in the HTML, and tried all your suggestions. None seemed to change the outcome, my only thought now is that I'm working on a Mac and that it is some kind of browser issue. I'll have to test it on a PC and see how it looks.
精彩评论