0

I create a table having circles in TDs. Please take a look at this sample at HERE

I want to get spaces in between these circles by trying to add more style in CSS

border-spacing: 10px;
border-collapse: separate;

but somehow it doesn't show up spaces. Please help!

Below is the code:

table tr td{
    background-color:green;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    border-spacing: 10px;
    border-collapse: separate;
}
<table>
  <tr>
      <td>Test</td>
      <td>Test</td>
      <td>Test</td>
      <td>Test</td>
  </tr>
    <tr>
      <td>Test</td>
      <td>Test</td>
      <td>Test</td>
      <td>Test</td>
  </tr>
</table>
Turnip
  • 34,740
  • 15
  • 87
  • 106
abcid d
  • 2,577
  • 7
  • 26
  • 43

1 Answers1

2

border-spacing and border-collapse should be set on the table, not the td.

table {
  border-spacing: 10px;
  border-collapse: separate;
}

table tr td{
    background-color:green;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
}
<table>
  <tr>
      <td>Test</td>
      <td>Test</td>
      <td>Test</td>
      <td>Test</td>
  </tr>
    <tr>
      <td>Test</td>
      <td>Test</td>
      <td>Test</td>
      <td>Test</td>
  </tr>
</table>
Turnip
  • 34,740
  • 15
  • 87
  • 106