Difference between revisions of "Table (HTML)"

From Wiki @ Karl Jones dot com
Jump to: navigation, search
(Created page with "In HTML, tables represent tabular data: information expressed via two dimensions or more. == Description == The HTML table model allows authors to arrange d...")
 
m (Karl Jones moved page Tables (HTML) to Table (HTML))
(No difference)

Revision as of 11:43, 16 May 2016

In HTML, tables represent tabular data: information expressed via two dimensions or more.

Description

The HTML table model allows authors to arrange data -- text, preformatted text, images, links, forms, form fields, other tables, etc. -- into rows and columns of cells.

Each table may have an associated caption (see the [[Caption (HTML element)|caption element) that provides a short description of the table's purpose.

A longer description may also be provided (via the summary attribute) for the benefit of people using speech or Braille-based user agents.

Table rows may be grouped into a head, foot, and body sections, (via the Thead (HTML element)thead, tfoot and tbody elements, respectively).

Row groups convey additional structural information and may be rendered by user agents in ways that emphasize this structure. User agents may exploit the head/body/foot division to support scrolling of body sections independently of the head and foot sections.

When long tables are printed, the head and foot information may be repeated on each page that contains table data.

Authors may also group columns to provide additional structural information that may be exploited by user agents.

Furthermore, authors may declare column properties at the start of a table definition (via the colgroup and col elements) in a way that enables user agents to render the table incrementally rather than having to wait for all the table data to arrive before rendering.

Table cells may either contain "header" information (see the ThTH element) or "data" (see the td element).

Cells may span multiple rows and columns.

Cell labels

The HTML 4 table model allows authors to label each cell so that non-visual user agents may more easily communicate heading information about the cell to the user.

Not only do these mechanisms greatly assist users with visual disabilities, they make it possible for multi-modal wireless browsers with limited display capabilities (e.g., Web-enabled pagers and phones) to handle tables.

Tables should not be used for layout

Tables should not be used purely as a means to layout document content as this may present problems when rendering to non-visual media.

Additionally, when used with graphics, these tables may force users to scroll horizontally to view a table designed on a system with a larger display.

To minimize these problems, authors should use style sheets to control layout rather than tables.

See also

External links