HTML and CSS Reference
In-Depth Information
onpause, onplay, onplaying, onprogress, onratechange, onreadystatechange,
onscroll, onseeked, onseeking, onselect, onshow, onstalled, onsubmit,
onsuspend, ontimeupdate, onvolumechange, onwaiting
Events Defined by Internet Explorer
onactivate, onbeforeactivate, onbeforecopy, onbeforecut, onbeforedeactivate,
onbeforeeditfocus, onbeforepaste, onblur, onclick, oncontextmenu,
oncontrolselect, oncopy, oncut, ondblclick, ondeactivate, ondrag,
ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop,
onfocus, onfocusin, onfocusout, onhelp, onkeydown, onkeypress, onkeyup,
onlosecapture, onmousedown, onmouseenter, onmouseleave, onmousemove,
onmouseout, onmouseover, onmouseup, onmousewheel, onmove, onmoveend,
onmovestart, onpaste, onpropertychange, onreadystatechange, onresize,
onresizeend, onresizestart, onselectstart, ontimeerror
Element-Specific Attributes
align
This attribute is used to align the contents of the cells within a
<tbody>
tag.
Common values are
center
,
justify
,
left
, and
right
. The specification also defines a
value of
char
. When
align
is set to
char
, the attribute
char
must be present and set to the
character to which cells should be aligned. A common use of this approach would be to set
cells to align on a decimal point. Unfortunately, browsers do not support the
char
value for
align
well.
bgcolor
This attribute specifies a background color for the cells within a
<tbody>
tag. Its
value can be either a named color, such as
red
, or a color specified in the hexadecimal
#RRGGBB
format, such as
#FF0000
.
char
This attribute is used to define the character to which element contents are aligned
when the
align
attribute is set to the
char
value.
charoff
This attribute contains an offset as a positive or negative integer to align characters
as related to the
char
value. A value of
2
would align characters in a cell two characters to
the right of the character defined by the
char
attribute.
valign
This attribute is used to set the vertical alignment for the table cells within a
<tbody>
tag. The HTML specification defines
baseline
,
bottom
,
middle
, and
top
.
Internet Explorer also supports
center
, which should act like
middle
.
Example
<table rule="all">
<thead>
<tr>
<td>
Region
</td>
<th>
Regular Widget
</th>
<th>
Super Widget
</th>
</tr>
</thead>
<tbody>
<tr>
<th>
West Coast
</th>