Use the cellpadding attribute to create some space around the contents of table cells (in
td elements). The effect of this attribute’s application won’t be immediately obvious unless you’ve also set a
border attribute for the table, as Figure 1 reveals.
The cellpadding attribute is similar to the
cellspacing attribute, which is used to create space between and outside of the table cells.
cellpadding for this
table is set to
<table border="1" cellpadding="5"> <tr> <th>Account Type</th> <th>Interest Rate</th> </tr> <tr> <td>Smart</td> <td>From 2%</td> </tr> <tr> <td>Young Saver</td> <td>From 1.6%</td> </tr> </table>
This attribute takes a numerical value, which reflects a pixel measurement.
The Principles of Beautiful Web Design, 4th Edition
Docker for Web Developers
Learn PHP in One Day and Learn It Well