Producing web pages
* HTML CSS DHTML XHTML A to Z of tags        Accessibility          Design

<td>

<td
abbr=text
align=center|left|right|justify
axis=name
background=url
bgcolor=colour
bordercolour=colour
bordercolordark=colour
bordercolorlight=colour
char=char
charoff=n
class=type
colspan=n
dir=ltr|rtr
height=n
id=value
lang=language
nowrap
rowspan=n
style=style
title=text
valign=middle|top|bottom|baseline
width=n
</td>

Creates a cell in a table. The end-tag is optional. This tag is valid only within a row in a table, that is, you must use a <tr> tag before using <td>. All attributes are optional.

Attributes

abbr=text

An abbreviated form of the cell’s content. May be used by speech browsers.

align=center|left|right|justify

Specifies the horizontal alignment of text in a cell. The default is center.

Value…

Description…

center

The text is centred in the cell

left

The text is aligned with the left side of the cell

right

The text is aligned with the right side of the cell

justify

The text in the cell is justified

axis=name

Provides a method of categorizing cells. The attribute's value is a comma-separated list of category names.

background=url

Specifies a background picture. The picture is tiled behind the text and graphics in the table, table head, or table cell.

bgcolor=colour

The background colour. Enter a hexadecimal, a red-green-blue colour value or a predefined colour name. See Using colour.

bordercolor=colour

Sets border colour. Must be used with the border attribute of the <table> tag. The colour is a hexadecimal, a red-green-blue colour value or a predefined colour name. See Using colour.

bordercolordark=colour

Sets independent border colour control over one of the two colours used to draw a 3-D border, opposite of bordercolorlight. Must be used with the border attribute of the <table> tag. The colour is a hexadecimal, a red-green-blue colour value or a predefined colour name. See Using colour.

bordercolorlight=colour

Sets independent border colour control over one of the two colours used to draw a 3-D border, opposite of bordercolordark. Must be used with the border attribute of the <table> tag. The colour is a hexadecimal, a red-green-blue colour value or a predefined colour name. See Using Colour.

char=char

A single character for the alignment of text in the column. The default value is the decimal point of the current language

charoff=n

Specifies the offset to the first occurrence of the alignment character. The attribute's value is a number in pixels or a percentage of the cell's width

class=type

Indicates the class to which the tag belongs. You can use the class attribute in a style sheet to create different styles that you want apply to a single HTML tag. For example, you might create three different styles for a <td> tag. See Using the class attribute as a selector for more details.

colspan=n

Extends the content of a cell into cells of the adjoining columns. The number of columns that are overlapped is indicated by n.

dir=ltr|rtr

Specifies the direction of text. This can be left-to-right (ltr) or right-to-left (rtl). For example, English characters are presented left-to-right, Hebrew characters are presented right-to-left.

height=n

Specifies the height of the table cell.

id=value

Specifies a unique name for the tag. No two tags can have the same id on a single page. The value must begin with a letter followed by any alphanumeric character, a hyphen, an underscore, a colon or a full stop. You use it to reference a unique style for a tag or to manipulate the tag with a script.

lang=language

Specifies which language the <td> tag uses. You can enter any valid ISO standard language abbreviation, for example, “en” for English, “de” for German and so on. For example, <span lang="es">hola! como esta?</span>.

This attribute helps search engines understand different languages as different languages rather than just misspelled English. It may also help spelling and grammar checkers and allow speech synthesizers to use language-dependent pronunciation rules.

nowrap

Prevents table columns from wrapping if they extend beyond the page.

rowspan=n

Extends the content of a cell into cells in the adjoining rows. The number of rows that are overlapped is indicated by n.

style=style

Specifies style information. See Style sheets for more information.

title=text

For information only. Some browsers display the title when you move the mouse over the tag (like a tool tip).

valign=middle|top|bottom|baseline

Specifies the vertical alignment of text in the cell. The default is middle.

Value…

Description…

middle

Text is aligned in the middle of each cell

top

Text is aligned with the top of each cell

bottom

Text is aligned with the bottom each cell

baseline

Text in adjoining cells in a row is aligned along a common baseline

width=n

Specifies the width of the table cell.