You cannot give margin to the table row. you can either give border-colapse and border spacing to the table or give border to table row and change its color to table background color.
To set cell padding in HTML, use the style attribute. The style attribute specifies an inline style for an element. The attribute is used with the HTML <table> tag, with the CSS property padding.
You can't add padding or margins to a 'tr' they are simply a mechanism to separate cells into rows.
Table rows cannot have margin values. Can you increase the padding? That would work. Otherwise you could insert a <tr class="spacer"></tr>
before and after the class="highlighted"
rows.
The border-spacing
property will work for this particular case.
table {
border-collapse:separate;
border-spacing: 0 1em;
}
Reference.
You can't style the <tr>
s themselves, but you can give the <td>
s inside the "highlight" <tr>
s a style, like this
tr.highlight td {padding-top: 10px; padding-bottom:10px}
line-height can be the possible solution
tr
{
line-height:30px;
}
This isn't going to be exactly perfect though I was happy to discover that you can control the horizontal and vertical border-spacing separately:
table
{
border-collapse: separate;
border-spacing: 0 8px;
}
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