Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

HTML <td> tag


May 05, 2021 HTML Reference Manual


Table of contents


HTML

Please refer to the following example for a label that represents a cell in a label:

A simple HTML table with two cells:

<table border="1">
<tr>
<td>Cell A</td>
<td>Cell B</td>
</tr>
</table>

Try it out . . .
(See bottom of page for more examples)

Browser support

HTML <td> tag HTML <td> tag HTML <td> tag HTML <td> tag HTML <td> tag

All major browsers support the hashtag.


Label definition and instructions for use

The label defines the standard cells in the HTML table.

HTML tables have two cell types:

  • Header Cell - Contains header information (created by the element of the .lt;th-gt; element)
  • Standard Cells - Contains data (created by the element of slt;td?gt;

The text in the element is usually bold and centered.

The text in the element is usually normal left-aligned text.


Tips and comments

Tip: If you need to span content across multiple rows or columns, use the colspan and rowspan properties!


The difference between HTML 4.01 and HTML5

Some properties in HTML 4.01 are no longer supported in HTML 5.


Property

Attributes value describe
abbr text HTML5 does not support. Specify the abbreviation version of the content in the cell.
align left
right
center
justify
char
HTML5 does not support. The horizontal alignment of the cell content is specified.
axis category_name HTML5 does not support. Classify cells.
bgcolor rgb(x,x,x)
#xxxxxx
colorname
HTML5 does not support.HTML 4.01 has been discarded. Specify the background color of the cell.
char character HTML5 does not support. The content is arranged to be aligned based on which character.
charoff number HTML5 does not support. Specifies the offset of aligned characters.
colspan number The number of columns can be specified in the cell.
headers header_id Provisions one or more header cells associated with cells are specified.
height pixels
%
HTML5 does not support.HTML 4.01 has been discarded.
Set the height of the cell.
nowrap nowrap HTML5 does not support.HTML 4.01 has been discarded.
The contents in the cell are defined.
rowspan number Set the number of lines that can across the cell.
scope col
colgroup
row
rowgroup
HTML5 does not support. Defines the method of associating the head unit cell with the data cell.
valign top
middle
bottom
baseline
HTML5 does not support. The vertical arrangement of the cell content is specified.
width pixels
%
HTML5 does not support.HTML 4.01 has been discarded. Specifies the width of the cell.


Global properties

Labels support the global properties of HTML.


The event property

The tag supports the event properties of HTML.


HTML <td> tag

Try it - instance

The title in the table
This example shows how to display the table title.

Empty cell
This example shows how to use to work with cells without content.

Table with title
This example shows a table with a title.

The label in the table
This example shows how to display elements within other elements.

Table cells that span rows or columns
This example shows how to define table cells that span rows or columns.


Related articles

HTML tutorial: HTML tables

HTML DOM Reference Manual: Td Objects