How to set cellpadding and cellspacing in table with CSS?

Use padding on the cells and border-spacing on the table. The former will give you cellpadding while the latter will give you cellspacing.follow the short procedure below to get the result you need:

table { border-spacing: 5px; } /* cellspacing */

th, td { padding: 5px; } /* cellpadding */