Does anyone know how to create spacing between columns in an HTML table without affecting the rows?
In my table, each column has a border around it:
<table>
<tr>
<td style="padding:0 15px 0 15px;">hello</td>
<td style="padding:0 15px 0 15px;">world</td>
<td style="padding:0 15px 0 15px;">how</td>
<td style="padding:0 15px 0 15px;">are</td>
<td style="padding:0 15px 0 15px;">you?</td>
</tr>
<tr>
<td style="padding:0 15px 0 15px;">hello</td>
<td style="padding:0 15px 0 15px;">world</td>
<td style="padding:0 15px 0 15px;">how</td>
<td style="padding:0 15px 0 15px;">are</td>
<td style="padding:0 15px 0 15px;">you?</td>
</tr>
</table>
Css
table td{
border : 1px solid black;
border-spacing: 1em 0;
}