Table: Padding
Cell padding specifies the space between the cell content and its borders. If you do not specify a padding, the table cells will be displayed without padding. To set the padding, use the CSS padding property in the <style> element:
td { padding: 15px; }
Padding of 5 pixels: |
Padding of 15 pixels: |
Jill |
Smith |
50 |
Eve |
Jackson |
94 |
John |
Doe |
80 |
|
Jill |
Smith |
50 |
Eve |
Jackson |
94 |
John |
Doe |
80 |
|
I had used 5p and 15p as the class names for the td tag. They did not work. I found out that class names cannot start with a number. So I changed the names to "five" and "fifteen" and everything worked.