
Stephen M. answered 10/25/19
Experienced Practitioner-Certified Computer/Business Education Teacher
First, while HTML 5 still supports the 'cellpadding' attribute, it no longer supports 'cellspacing'. So your only recourse to achieve both effects in HTML 5 is through CSS.
The HTML 'cellpadding' attribute creates space between your cell content and the sides of a cell. With HTML you specify one value and it applies to all sides of your content (Top, Bottom, Left, and Right). In CSS you'll use the 'padding' property to achieve the same effect. The major difference is that in CSS you can specify different padding values for each side of the cell. To handle 'cellspacing' you'll use the 'border-spacing' property.
In CSS this could look like the following if you want to add 20px of padding around each cell, 10px of horizontal spacing between cell borders, and 30px of vertical spacing between cell borders:
You could also set padding for different sides of an element by using the padding-top, padding-right, padding-bottom, and padding-left properties.
Play with the code above to see the effect of changing values.