Looking to add some padding above and below my TABLE element, I came across the border-spacing property. Here's my table:
<table id="ranks">
<tbody><tr class="ranksHeaderRow">
<th></th>
<th>Name</th>
<th>Score</th>
<th>Votes Cast</th>
</tr>
<tr class="ranksDataRow even" data-id="25">
<td>1</td>
<td><a class="rankPersonLink" href="/votes/25">NameN</a></td>
<td>12.0</td>
<td>1</td>
</tr>
...
</table>
Here's the CSS style I applied:
#ranks {
margin: 0 auto;
width: 60%;
border-collapse: collapse;
border-spacing: 20px 20px 20px 20px;
}
Despite this, there seems to be no padding around the TABLE - see https://jsfiddle.net/00tjhxaw/. How can I get the desired padding without altering the surrounding DIV?
Furthermore, I prefer the absence of spacing between cells and want to maintain that.