Quantcast
Channel: Set cellpadding and cellspacing in CSS? - Stack Overflow
Viewing all articles
Browse latest Browse all 31

Answer by Alireza for Set cellpadding and cellspacing in CSS?

$
0
0

You can simply do something like this in your CSS, using border-spacing and padding:

table {
  border-collapse: collapse;
}

td, th {
  padding: 1em;
  border: 1px solid blue;
}
<table>
  <tr>
    <th>head_1</th>
    <th>head_2</th>
    <th>head_3</th>
    <th>head_4</th>
  </tr>
  <tr>
    <td>txt_1</td>
    <td>txt_2</td>
    <td>txt_3</td>
    <td>txt_4</td>
  </tr>
</table>

Viewing all articles
Browse latest Browse all 31

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>