DEV Community

wasifali
wasifali

Posted on

HTML tables, why we use and how to use?

HTML Tables:

HTML tables are used to arrange the data into rows and columns.
A table in HTML consists of table cells inside rows and columns.
To create the table we will use different tags, where the main one is
<table> </table>.

defines the table.
defines a row within the table.

tag.

td stands for table data.

HTML Table border:

HTML tables can have borders of different styles and shapes.

How To Add a Border

To add a border, use the CSS border property on table, th, and td elements:
Example:
table, th, td {
border: 1px solid black;
}


defines header cells within the row
defines data cells within the row.

Table cells:

Each table cell is defined by a

and a

Top comments (0)