Tbody and padding

Is it possible to style a tbody tag with padding?

Further to my post above, I was able to style the tbody with background-color, font-size and font-weight. But, unable to style the padding.

Can anybody explain the reasoning for this?


shrugs Elements that are part of a table handle padding and margins different from other elements.

fair enough.

The reason I was asking, is that we’re currently cleaning up a whole stack of web pages. Part of this is to remove <br> tags.
One scenario where we use them, is in an empty table row… eg:
<tr><td><br /></td></tr>

This was used to create a blank space between rows, to separate the content and make it easier to read.

I had planned on using the <tbody> tag, and styling it with a padding-bottom, however I can’t get this to work.

Are there any other semanticly correct ways to remove our <br>'s in this scenario to give a similar presentational result?


Perhaps you shouldn’t be using a <table>. Is the content of the table tabular data/information?

Could you apply padding to the <td>s?

yes - removal of tables is the next step. Because of the huge number of pages we need to clean up, it needs to be done in stages.

I think we will just end up creating a <tr> style with padding - i was just curious if there was any other techniques out there that are better.