Table in HTML

Table in HTML

The table is a very useful tag in HTML to organize data efficiently. It allows developers to arrange data in tabular form(i.e, row and column order). There can be many columns in a row. Tables can be used to organize data like text, images, videos, links etc.

The table can be created using <table> tag, <tr>, <th> and <td> tags. Where 'tr' stands for table row, 'th' stands for table heading, and 'td' stands for table data.

Tables have lots of properties-

(i) Table heading - It defines the header of the table i.e, which type of content lies under that heading.

(ii) Cell padding and spacing - cell padding means the space between the border and content. And cell spacing means space between each cell of the table by default cell spacing is 2px.

(iii) colspan and rowspan - These are used to specify the number of rows or columns that should merge.

(iv) Table background - It is used to define the color of the background of the table.

(v) Height and width- it is used to define the height and width of each cell.

(vi) Table caption - caption tag used to define the caption of the table.

Etc.