HTMLforall

  HTML | PHP | Forum

HTML <td> tag

Syntax

<td> - </td>

Definition and Usage

The TD element defines a cell in a table.

Optional Attributes

Attribute Value Description
abbr abbr_text Specifies an abbreviated version of the content in a cell
align left
right
center
justify
char
Specifies the horizontal alignment of cell content
axis category_names Defines a name for a cell
bgcolor rgb(x,x,x)
#xxxxxx
colorname
Specifies the background color of the table cell. Deprecated. Use styles instead.
char character Specifies which character to align text on.

Note: Only used if align="char"!

charoff pixels
%  
Specifies the alignment offset to the first character to align on.

Note: Only used if align="char"!

colspan number Indicates the number of columns this cell should span
headers header_cells'_id A space-separated list of cell IDs that supply header information for the cell. This attribute allows text-only browsers to render the header information for a given cell
height pixels Specifies the height of the table cell. Deprecated. Use styles instead.
nowrap nowrap Whether to disable or enable automatic text wrapping in this cell. Deprecated. Use styles instead.
rowspan number Indicates the number of rows this cell should span
scope col
colgroup
row
rowgroup
Specifies if this cell provides header information for the rest of the row that contains it (row), or for the rest of the column (col), or for the rest of the row group that contains it (rowgroup), or for the rest of the column group that contains it
valign top
middle
bottom
baseline
Specifies the vertical alignment of cell content
width pixels
%
Specifies the width of the table cell. Deprecated. Use styles instead.

Standard Attributes

id, class, title, style, dir, lang, xml:lang

For a full description, go to Standard Attributes.

Event Attributes

onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

For a full description, go to Event Attributes.

Example

Source Output
<table border = "4">
<tr>
<td>Cell 1</td>
<td>Cell 3</td>
</tr>
<tr>
<td>Cell 2</td>
<td>Cell 4</td>
</tr>
</table>
Cell 1 Cell 3
Cell 2 Cell 4

Home

Learn HTML
HTML Tutorial

HTML Reference
HTML by function
HTML by Alphabet

HTML events
HTML attributes
HTML color names

<!--...-->
<!DOCTYPE> 
<a>
<abbr>
<acronym>
<address>
<applet>
<area>
<b>
<base>
<basefont>
<bdo>
<big>
<blockquote>
<body>
<br>
<button>
<caption>
<center>
<cite>
<code>
<col>
<colgroup>
<dd>
<del>
<dfn>
<dir>
<div>
<dl>
<dt>
<em>
<fieldset>
<font>
<form>
<frame>
<frameset>
<h1> to <h6>
<head>
<hr>
<html>
<i>
<iframe>
<img>
<input>
<ins>
<isindex>
<kbd>
<label>
<legend>
<li>
<link>
<map>
<menu>
<meta>
<noframes>
<noscript>
<object>
<ol>
<optgroup>
<option>
<p>
<param>
<pre>
<q>
<s>
<samp>
<script>
<select>
<small>
<span>
<strike>
<strong>
<style>
<sub>
<sup>
<table>
<tbody>
<td>
<textarea>
<tfoot>
<th>
<thead>
<title>
<tr>
<tt>
<u>
<ul>
<var>

 

Copyright 2005-8 Sunilcare.  All Rights Reserved.
Comments or suggestions? Contact us.About us