Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is benefit of <thead>

Tags:

html

What is benefit of using thead instead of just td? If there is benefit...

like image 367
Praheed60 Avatar asked Apr 23 '10 16:04

Praheed60


2 Answers

The thead, tbody, and tfoot elements in HTML are used to group table rows into logical sections based on their content. There are two main reasons you'd want to do this:

  1. To allow the body to be scrolled independently of the header and/or footer

  2. To make it easier to apply different style rules to the different sections of the table.

like image 56
Syntactic Avatar answered Oct 05 '22 16:10

Syntactic


Table rows may be grouped into a table head, table foot, and one or more table body sections, using the THEAD, TFOOT and TBODY elements, respectively. This division enables user agents to support scrolling of table bodies independently of the table head and foot. When long tables are printed, the table head and foot information may be repeated on each page that contains table data.

The table head and table foot should contain information about the table's columns. The table body should contain rows of table data.

http://www.w3.org/TR/html401/struct/tables.html#h-11.2.3

like image 27
Jitendra Vyas Avatar answered Oct 05 '22 16:10

Jitendra Vyas