HTML Table Cell Spacing and Cell Padding
From w3cyberlearnings
Contents |
HTML Table Cell Padding and Spacing
By using CSS, you can define the table cell spacing and padding.
Example 1 TRY-IT
We define the table cell padding, cell spacing, and table border by using CSS.
<style> table { padding:8px; border-spacing: 10px; border:1px solid #2b81af; } td,th { padding:10px; } </style>
Example 2 TRY-IT
We define the table row color based on the odd and even row; we also define the cell spacing and cell padding.
<style> table { padding:8px; border-spacing: 40px; } .odd { background-color:blue; } .even { background-color:red; } </style>
Related Link
Table
- HTML - Table
- HTML - Table Border
- HTML - Table Column
- HTML - Table Row
- HTML - Table Color
- HTML - Table Cell Spacing and Padding
- HTML - Text Align
- HTML - Text Vertical Align
- HTML - Table Caption and Summary
- HTML - Table thead, tbody, tfoot
- HTML - Inner Table
- HTML - Table Vertical Line
- HTML - Table Horizontal Line