CSS Tables

CSS Tables

CSS Tables

Table Borders

To specify table borders in CSS, use the border property.

Table Size

Table Width and Height

The width and height of a table are defined by the width and height properties.

Horizontal Alignment

The text-align property sets the horizontal alignment (like left, right, or center) of the content in <th> or <td>.

Vertical Alignment

The vertical-align property sets the vertical alignment (like top, bottom, or middle) of the content in <th> or <td>.

Table Style

To control the space between the border and the content in a table, use the padding property on <td> and <th> elements:

Example👇🏻


image.png

Download our HTML & CSS Visual Treat! ebook Here: Click here