List and explain the different elements of a Table.
Answers
Answer:
The table element represents a table. These allow authors to represent tabular data in a document. In the code, a table basically consists of a group of rows that contain, each, a group of cells.
A table element acts only as a container where other elements can be declared. These elements are:
caption: provides a title for the table.
colgroup: groups columns thematically.
col: applies common attributes and styles to one or more columns. It can only be declared as child of colgroup.
tbody: represents the body section of a table.
thead: represents the header section of a table.
tfoot: represents the footer section of a table.
tr: represents a row. It can be declared as child of tbody, thead, tfoot or table.
td: represents a regular cell. It can only be declared as child of tr.
th: represents a header cell. It can only be declared as child of tr.
When tables are complex or hard to understand, authors should provide indications aimed to help the user in the interpretation of the data. This information can be presented in the surrounding text, as the table's caption or in the figcaption element, if the table is part of a figure element. Nevertheless, authors are encouraged to rearrange their tables in a way that no explanation is necessary, whenever it's possible.
Tables have been historically used to organize the layout of a website. This practice is non-conformant and may lead some browsers (like voice browsers) to obtain confusing results in their attemp to extract tabular data.
In previous versions of the standard, the table element had several presentational attributes that have been removed in HTML5. Authors should drop their use in favor of style sheets.
Make me a brilliant please ok let me now