HTML TABLE TAGS


 

Frequently used feature that organizes data into rows and columns. A table has three distinct sections—head, body and foot.

The head section (or header cell) contains header information such as column names. The body section, or table body, contains the table’s primary data. The foot section represents a footer. The Data cells in the table body contain individual pieces of data.

 

Table tags

TAG

FUNCTION

<TABLE>

(Container tag)

Attributes – 10

Contains all HTML tags that compose a table

<CAPTION>

(Container tag)

Attributes – 1

Specifies a caption for a table.

<THEAD>

(Container tag)

Attributes – 4

Defines the header section of a table. Useful when table is broken across multiple pages.

<TFOOT>

(Container tag)

Attributes –

Defines the footer section of the table

<TBODY>

(Container tag)

Attributes –

Defines the body section of the table

<COLGROUP>

(Container tag)

Attributes –

Groups a set of columns so that properties may be assigned to all columns in the group rather than to each one individually

<COL>

(Container tag)

Attributes –

Specifies properties for a column or columns within a group

<TR>

(Container tag)

Attributes –

Defines a row of a table, table header, table footer, or table body

<TD>

(Container tag)

Attributes –

Defines a cell in a table for data.

<TH>

(Container tag)

Attributes –

Defines a cell in a table for header data which is normally rendered in boldface and with a centered horizontal alignment.

 

Tag: <TABLE>

Attribute

Description and values

ALIGN

Controls how the table is aligned on the page. (values: LEFT, CENTER, and RIGHT)

BORDER

Specifies the thickness of the table border in pixels

BGCOLOR

Set equal to the background color to use in the cells of the table

CELLPADDING

Controls the amount of whitespace between the contents of a cell and the edge of the cell

CELLSPACING

Specifies how many pixels of space to leave between individual cells

COLS

Set equal to the number of columns in the table.

FRAME

Controls which parts of the table's outer border are rendered. (Values: ABOVE, BELOW, BORDER/ BOX(All sides), HSIDES/ RHS, VSIDES / LHS, VOID)

RULES

Controls which parts of the table's inner borders are displayed. (Values: ALL, COLS, GROUPS, NONE, ROWS)

SUMMARY

Provides a synopsis of what's in the table and how the table is structured.

WIDTH

Specifies the width of the table in pixels or as a percentage of the browser screen width.

 

Tag: <CAPTION>

Attribute

Description and values

ALIGN

Places the table name above or below the table

(Value: TOP | BOTTOM)

 


Tag: <THEAD>, <TFOOT>, <TBODY>,

<COLGROUP>, <COL>, <TR>, <TD>, <TH>

(COMMON ATTRIBUTES)

Attribute

Description and values

ALIGN

Controls the horizontal alignment within the cells of the table header. (Value: LEFT, RIGHT, CENTER, JUSTIFY, or CHAR. CHAR is used to align cells by a common character.)

CHAR

Specifies the alignment character for when ALIGN=”CHAR” is used

CHAROFF

Prescribes the offset distance from the alignment character

VALIGN

Controls the vertical alignment in the header cells. (Value: TOP, MIDDLE, BOTTOM or BASELINE)

 

(Additional attributes for <COLGROUP>, <COL>, <TD> and <TH>)

Tag: <COLGROUP>

Attribute

Description and values

SPAN

Tells the browser how many columns are in the group

WIDTH

Specifies the width of the enclosed column (Value: pixels / relative width in percentage)

 

Tag: <COL>

Attribute

Description and values

SPAN

Tells the browser how many columns to which to apply the property

WIDTH

Specifies the width of the column or column group (Value: pixels / relative width in percentage)

 

Tag: <TD>, <TH>

Attribute

Description and values

AXIS

Used to group cells into logical categories

COLSPAN

Specifies the number of columns the cell should occupy

HEADERS

Provides a list of IDs of cells that provide header information for the current cell

NOWRAP

Suppresses text wrapping within the cell

ROWSPAN

Specifies the number of rows the cell should occupy

SCOPE

A simpler form of the AXIS attribute, SCOPE allows to group cells into rows, columns, row groups, or column groups, instead of arbitrarily named logical groups.

 

No comments:

Post a Comment

Don't be a silent reader...
Leave your comments...

Anu