I have an html table that looks like this:
<table style="border-spacing: 10px">
<tr style='background-color:red'>
<td><b>Member</b></td>
<td><b>Account #</b></td>
<td><b>Site</b></td>
<td><b>Date</b></td>
</tr>
</table>
The padding in between the elements is fine, but the background color seems to only fill the TDs and leave lots of gaps because of padding/spacing. How can I make the TR background color fill the entire row, and flow through the 10px border spacing?
Use the border-collapse:collapse;
to collapse the gaps and add any padding you need with:
table {
border-collapse:collapse;
}
td {
padding: 8px;
}
jsFiddle example
Apply the background on the table
not on the tr
:
<table style="border-spacing: 10px; background-color:red;">
<tr style=''>
<td><b>Member</b></td>
<td><b>Account #</b></td>
<td><b>Site</b></td>
<td><b>Date</b></td>
</tr>
</table>
http://jsfiddle.net/helderdarocha/C7NBy/
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