HTML CSS Bootstrap Javascript Icons Python
HTML References
HTML - Tag Reference HTML - Tag by Category HTML - Attributes HTML - Global Attributes HTML - Events HTML - Language Codes HTML - Country Codes HTML - URL Encoding HTTP Methods HTTP Status Codes <input> types
All HTML Tags
<!-- --> <!DOCTYPE> <a> <abbr> <acronym> <address> <applet> <area> <article> <aside> <audio> <b> <base> <basefont> <bdi> <bdo> <big> <blockquote> <body> <br> <button> <canvas> <caption> <center> <cite> <code> <col> <colgroup> <data> <datalist> <dd> <del> <details> <dfn> <dialog> <dir> <div> <dl> <dt> <em> <embed> <fieldset> <figcaption> <figure> <font> <footer> <form> <frame> <frameset> <h1> - <h6> <head> <header> <hr> <html> <i> <iframe> <img> <input> <ins> <kbd> <label> <legend> <li> <link> <main> <map> <mark> <meta> <meter> <nav> <noframes> <noscript> <object> <ol> <optgroup> <option> <output> <p> <param> <picture> <pre> <progress> <q> <rp> <rt> <ruby> <s> <samp> <script> <section> <select> <small> <source> <span> <strike> <strong> <style> <sub> <summary> <sup> <svg> <table> <tbody> <td> <template> <textarea> <tfoot> <th> <thead> <time> <title> <tr> <track> <tt> <u> <ul> <var> <video> <wbr>

HTML <td> tag

The HTML <td> element defines a cell of a table that contains data.

A table has two kinds of cells:

Run code

Use the colspan and rowspan attribute to let the content span over multiple columns or rows:

Browser compatibility

The <td> element is fully supported by all browsers:

Element
<td> yes yes yes yes yes



Attributes

The following table shows the attributes that are specific to the <td> tag:

Attribute Value Description
abbr text Not supported in HTML5.
Specifies an abbreviated version of the content in a cell
align left
right
center
justify
char
Not supported in HTML5.
Specifies how the cell content's horizontal alignment will be handled
axis name Not supported in HTML5.
Specifies a category for this td
bgcolor color_value Not supported in HTML5.
Specifies the background color of the table cell
char character Not supported in HTML5.
Set the character to align the cells in a column on
charoff number Not supported in HTML5.
Indicate the number of characters to offset the column data from the alignment characters
colspan number Specifies the number of columns the current cell spans across
headers id This attribute contains a list of space-separated strings, each corresponding to the id attribute of the th elements that apply to this element
height pixels Not supported in HTML5.
Specifies the height of the table cell
nowrap - Not supported in HTML5.
Specifies that the content inside a cell should not wrap
rowspan number Specifies the number of rows the current cell spans across
scope col
colgroup
row
rowgroup
Not supported in HTML5.
This attribute is used on header cells and specifies the cells that will use this header's information
valign top
middle
bottom
baseline
Not supported in HTML5.
Specifies how a text is vertically aligned inside a cell
width pixels
%
Not supported in HTML5.
Specifies the width of a cell

Global Attributes

The <td> tag supports the global attributes described in HTML Global Attributes Reference

Event Attributes

The <td> tag supports the event attributes described in HTML Events Reference

Last updated: Monday 01 Oct, 2018