Is there any way to give spacing between <td>
as in the figure below?
OBS: With right-only spacing of <td>
.
I got the effect you need by putting a class in the td of the column in question and using a custom css for it:
td { background: gray; padding:10px }
.tdEspaco { display: table; float:left; margin-right:10px }
table { border-spacing: 5px; }
<table>
<tr>
<td class='tdEspaco'>1</td>
<td >2</td>
<td >3</td>
</tr>
<tr>
<td class='tdEspaco'>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr>
<td class='tdEspaco'>1</td>
<td>2</td>
<td>3</td>
</tr>
</table>
Yes, there is a form using border-collpse
and border-spacing
in CSS :
table td {
border: solid 1px #000;
}
table{
border-collapse: separate;
border-spacing: 10px;
margin: 0 0 0 0;
}
<table>
<tr>
<td>Coluna 1
</td>
<td>
Coluna 2
</td>
</tr>
<tr>
<td>Coluna 1
</td>
<td>
Coluna 2
</td>
</tr>
</table>
You can use the css
border-spacing property in your table
.
table {
border-spacing: 15px 10px;
}
table>tbody>tr>td {
background: blue;
padding: 5px 20px;
}
<table>
<tr>
<td>Coluna 1
</td>
<td>
Coluna 2
</td>
</tr>
<tr>
<td>Coluna 1
</td>
<td>
Coluna 2
</td>
</tr>
</table>
I got simpler impossible
border-right: solid 10px #fff;
border-bottom: solid 3px #fff;