Set cellpadding and cellspacing in CSS?

The cellpadding and cellspacing attributes are used to control the spacing within and around table cells in HTML. They can be set using the padding and border-spacing properties in CSS, respectively.

Here’s an example of how you can set the cellpadding and cellspacing of a table using CSS:

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

This will set the cellspacing to 10px and the cellpadding to 10px for all table elements on the page.

Note that the border-collapse property must be set to separate in order for the border-spacing property to have an effect.

Keep in mind that the cellpadding and cellspacing attributes are deprecated in HTML5, and you should use CSS to style tables instead.