When you use a table
tag and add border="1"
, what is the actual value of that border? It's not 1 pixel because when I try to replicate it's much thinner than the border=1 version. So:
"border=1"
is a thicker line
style="border:1px solid #000"
is a thinner line
I am trying to replicate it but can't find a match.
EDIT: I need to do this inline as there will not be a style sheet. Please let me know if this can be done inline at all.
The difference between the border
attribute and the style
attribute is that the former also gives borders to the cells inside, while the latter doesn't.
So that got me thinking, and my guess is that you haven't given all the information needed to replicate the problem. So please correct me if I'm wrong, but I am assuming that you also had cellspacing="0"
on the table, and in the attempted styled version, no style
attribute on the table cells.
<table border="1" cellspacing="0">
<tr><td>with border attr</td></tr>
</table>
<br>
<table style="border:1px solid #000">
<tr><td>with style props</td></tr>
</table>
So in the top table, the table has a 1px border, and the cell inside also does. And there you have it, 2px border in total.
This situation can be emulated using styles; you just need some more styles.
<table border="1" cellspacing="0"> <!-- same as above -->
<tr><td>with border attr</td></tr>
</table>
<br>
<table style="border:1px outset #000; border-spacing:0">
<tr><td style="border:1px inset #000">with style props</td></tr>
</table>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With