This stands for table data, and specifies a standard table data cell. Table data cells must only appear within table rows. Each row need not have the same number of cells specified as short rows will be padded with blank cells on the right. A cell can contain any of the HTML elements normally present in the body of an HTML document.
<TD ...> ... </TD>
can accept the following attributes.
ALIGN="left|center|right"
This attribute controls whether text inside the table cell(s) is aligned to the left, right or centred within the cell.
VALIGN="top|middle|bottom|baseline"
The VALIGN
attribute controls whether text inside the table cell(s) is aligned to the top, bottom, or vertically centred within the cell. It can also specify that all the cells in the row should be vertically aligned to the same baseline.
WIDTH="value_or_percent"
If used, this attribute can specify either the exact width of the data cell in pixels, or the width of the data cell as a percentage of the table being displayed. Only one data cell can set the width for an entire column, so it is good practice to specify all data cells in the same column as having the same width, if the attribute is set at all.
HEIGHT="value_or_percent"
If used, this attribute can specify either the exact height of the data cell in pixels, or the height of the data cell as a percentage of the browser display window. Only one data cell can set the height for an entire row.
NOTE : Netscape supports use of the WIDTH="value%"
and "pixel_value"
for this element (it only supports the HEIGHT="%value"
attribute for the main <TABLE>
element). Internet Explorer supports both percentage and pixel values for both the HEIGHT
and WIDTH
attributes.
For WIDTH="%value"
settings, the WIDTH="%value"
also needs to be set in the main <TABLE>
element and the cell/header columns (affected by any cell with a WIDTH="%value"
setting) will be scaled as a percentage of the table width (which would be scaled as a percentage of the browser window). Also, for WIDTH="value"
settings, the table will only be sized to the maximum extent of the browser window width (with cells/headers being scaled accordingly), unless the WIDTH="value"
setting is used in the main <TABLE>
element, set to the combined size of the cells/headers.
For HEIGHT="%value"
settings, the cell (and any rows it is part of) will be rendered as the percentage of the browser window, regardless of any HEIGHT
settings in the main <TABLE>
. If only one cell has a WIDTH
or HEIGHT
attribute set, then that setting is used for all the columns/rows of the table that the cell is part of. If more than one cell in a row or column have WIDTH
or HEIGHT
attributes set, then the largest setting of all the constituent data cells will be used for the entire row/column of the table.
NOWRAP
If this attribute appears in any table cell (<TH>
or <TD>
) it means the lines within this cell cannot be broken to fit the width of the cell. Be cautious in use of this attribute as it can result in excessively wide cells.
COLSPAN="value"
This attribute can appear in any table cell (<TH>
or <TD>
) and it specifies how many columns of the table this cell should span. The default COLSPAN
for any cell is 1.
ROWSPAN="value"
This attribute can appear in any table cell (<TH>
or <TD>
) and it specifies how many rows of the table this cell should span. The default ROWSPAN
for any cell is 1. A span that extends into rows that were never specified with a <TR>
will be truncated.
BGCOLOR="#rrggbb|colour name"
Internet Explorer and Netscape support use of this attribute (also supported in the <BODY>
element). It allows the background colour of the data cell to be specified, using either the specified colour names, or a rrggbb hex triplet.
BORDERCOLOR="#rrggbb|colour name"
Internet Explorer includes support for this attribute which sets the border colour of the data cell. Any of the pre-defined colour names can be used, as well as any colour defined by a rrggbb hex triplet. It is necessary for the BORDER
attribute to be present in the main <TABLE>
element for border colouring to work.
BORDERCOLORLIGHT="#rrggbb|colour name"
Internet Explorer allows use of the BORDERCOLORLIGHT
attribute to set independently, the lighter colour to be displayed on a 3-dimensional data cell border. It is the opposite of BORDERCOLORDARK
. Any of the pre-defined colour names can be used, as well as any colour defined by a rrggbb hex triplet. It is necessary for the BORDER
attribute to be present in the main <TABLE>
element for border colouring to work.
BORDERCOLORDARK="#rrggbb|colour name"
Internet Explorer allows use of the BORDERCOLORDARK
attribute to set independently, the darker colour to be displayed on a 3-dimensional data cell border. It is the opposite of BORDERCOLORLIGHT
. Any of the pre-defined colour names can be used, as well as any colour defined by a rrggbb hex triplet. It is necessary for the BORDER
attribute to be present in the main <TABLE>
element for border colouring to work.
NOTE : The BGCOLOR
, BORDERCOLOR
, BORDERCOLORLIGHT
and BORDERCOLORDARK
attributes can also be used in <TABLE>
, <TH>
and <TR>
elements, with the colour defined in the last element over-riding those defined before. E.g. if a <TD>
element contains a BORDERCOLOR
attribute setting, the setting specified will be used instead of any colour settings that may have been specified in the <TR>
element, which in turn over-rides any colour settings in the <TABLE>
element.
BACKGROUND="URL of image"
Internet Explorer and Netscape support the placing of images inside the <TD>
element. (Also in the <TABLE>
, and <TH>
elements) If used in the <TD>
element, the image in question will be tiled behind the particular data cell. Any of the supported graphic file formats can be used as a graphic behind a table.
TITLE="informational ToolTip"
The Internet Explorer 4.0 (and above) specific TITLE
attribute is used for informational purposes. If present, the value of the TITLE
attribute is presented as a ToolTip when the users mouse hovers over the <TD>
section.
LANG="language setting"
The LANG
attribute can be used to specify what language the <TD>
element is using. It accepts any valid ISO standard language abbreviation (for example "en"
for English, "de"
for German etc.) For more details, see the Document Localisation section for more details.
LANGUAGE="Scripting language"
The LANGUAGE
attribute can be used to expressly specify which scripting language Internet Explorer 4.0 uses to interpret any scripting information used in the <TD>
element. It can accept values of vbscript
, vbs
, javascript
or jscript
. The first two specify the scripting language as Visual Basic Script, the latter two specify it as using Javascript (the default scripting language used if no LANGUAGE
attribute is set.
CLASS="Style Sheet class name"
The CLASS
attribute is used to specify the <TD>
element as using a particular style sheet class. See the Style Sheets topic for details.
STYLE="In line style setting"
As well as using previously defined style sheet settings, the <TD>
element can have in-line stylings attached to it. See the Style Sheets topic for details.
ID="Unique element identifier"
The ID
attribute can be used to either reference a unique style sheet identifier, or to provide a unique name for the <TD>
element for scripting purposes. Any <TD>
element with an ID
attribute can be directly manipulated in script by referencing its ID
attribute, rather than working through the All collection to determine the element. See the Scripting introduction topic for more information.
Every <TD>
element in a document is an object that can be manipulated through scripting. Note that scripting of the <TD>
element/object is only supported by Internet Explorer 4.0 in its Dynamic HTML object model. Netscape does not support direct scripting of the <TD>
element at all.
<TD...>
Properties
Of the standard Dynamic HTML properties, the <TD...>
element/object supports the following: className, document, id, innerText, isTextEdit, lang, language, offsetHeight, offsetLeft, offsetParent, offsetTop, offsetWidth, outerText, parentElement, parentTextEdit, sourceIndex, style, tagName and title. Details of these can be found in the standard Dynamic HTML properties topics.
<TD>
also supports the following properties, which directly reflect attributes of the <TD>
element: align, background, bgColor, borderColor, borderColorDark, borderColorLight, colSpan, height, noWrap, rowSpan, vAlign and width; and also supports:
cellIndex
The cellIndex
property returns the index of the referenced <TD>
elements position in the Cells Collection for a given row. If a cell spans several rows (using the ROWSPAN
attribute), it only has a cellIndex
property in the first row in which it is contained.
clientHeight
The clientHeight
property reflects the height (in pixels) of the contents of the <TD>
element.
clientWidth
The clientWidth
property reflects the width (in pixels) of the contents of the <TD>
element.
<TD...>
Methods
The <TD...>
element/object supports all of the standard Dynamic HTML methods (i.e. click, contains, getAttribute, insertAdjacentHTML, insertAdjacentText, removeAttribute, scrollIntoView and setAttribute). Details of these can be found in the standard Dynamic HTML Methods topics.
Additionally, the <TD>
element supports:
blur
The blur
event can be used to force the users focus away from the referenced <TD>
element, firing the onblur
event.
focus
The focus
method can be used to pass the users focus to the referenced <TD>
element, forcing the onfocus
event to fire.
<TD...>
Events
The <TD...>
element/object supports all of the standard Dynamic HTML events (i.e. onclick, ondblclick, ondragstart, onfilterchange, onhelp, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup and onselectstart). Details of these can be found in the standard Dynamic HTML events topics.
Also, the <TD>
element supports:
onafterupdate
The onafterupdate
event is fired after data is transferred from the element to the data provider and will only fire after the onbeforeupdate
event has fired and was successful. For more information on Data Binding, see the Data Binding topic.
onbeforeupdate
onbeforeupdate
fires when a data bound element loses the focus, or the current document is unloaded and will only fire if the value of the element is different to the original value that was present when the element received the users focus. Note that onbeforeupdate
is a cancelable event (setting returnValue=false
for the Event object), which allows the document /script author a chance to validate the new data entered by the user on the client-side, before sending the data to the data provider. For more information on Data Binding, see the Data Binding topic.
onblur
When the referenced <TD>
element loses the users focus, the onblur
event is fired, executing any script events that are attached to it.
onfocus
When the user passes the focus to any <TD>
element, the onfocus
event is fired for that element.
onresize
The onresize
event is fired whenever the contents of the <TD>
element are resized, by window movement, or dynamically through scripting.
onrowenter
The onrowenter
event fires on the data source control when the current record has been changed, so new data is available to populate the HTML display elements that are bound to the data source. Somewhat confusingly, this will typically happen after the onrowexit
event has been fired. For more information on Data Binding, see the Data Binding topic.
onrowexit
The onrowexit
event is fired immediately before the data source changes the current record (i.e. when the user has requested another record, or set of records by pressing a button perhaps). Note that unlike the anafterupdate
and onbeforeupdate
events, onrowexit
is fired by the data source, not any of the HTML elements used to display the data. Changes to the data in the HTML elements should have been transferred to the data source (with validation being taken care of in the on*update
events). onrowexit
will also fire if the record position is changed through scripting. For more information on Data Binding, see the Data Binding topic.
© 1995-1998, Stephen Le Hunte
file: /Techref/language/html/ib/Tables/td.htm, 19KB, , updated: 2004/3/1 15:47, local time: 2024/11/22 00:38,
3.133.157.231:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://ecomorder.com/techref/language/html/ib/Tables/td.htm"> <TD></A> |
Did you find what you needed? |
Welcome to ecomorder.com! |
Welcome to ecomorder.com! |
.