HTML Element: td

The <td> element (“table data”) represents a data cell in a <table>. It’s nested inside the <tr> (“table row”) element.

Example

Syntax

1
<table>
2
  <tr>
3
    <td>Jane</td>
4
    <td>Doe</td>
5
    <td>Web Developer</td>
6
  </tr>
7
</table>

Result

Browser Support

The <td> tag is supported in all modern browsers as well as many email clients. Read more on caniuse.com.

Attributes

The <td> tag supports Global Attributes in HTML. Global Attributes are common to all HTML elements and can be used on all of them (though they may not have much of an effect on some of them).

The <td> element also supports:

  • colspan – Number of columns that the cell is to span.
  • rowspan – Number of rows that the cell is to span.
  • headers – The header cells for the cell.

Content

Within a <td> flow content is supported.

Learn More

Did you know? A <td> element’s end tag (</td>) can be omitted if the <td> element is immediately followed by a <td> or <th> element, or if there is no more content in the parent element.


This content originally appeared on Envato Tuts+ Tutorials and was authored by Andy Leverenz

The <td> element (“table data”) represents a data cell in a <table>. It’s nested inside the <tr> (“table row”) element.

Example

Syntax

1
<table>
2
  <tr>
3
    <td>Jane</td>
4
    <td>Doe</td>
5
    <td>Web Developer</td>
6
  </tr>
7
</table>

Result

Browser Support

The <td> tag is supported in all modern browsers as well as many email clients. Read more on caniuse.com.

Attributes

The <td> tag supports Global Attributes in HTML. Global Attributes are common to all HTML elements and can be used on all of them (though they may not have much of an effect on some of them).

The <td> element also supports:

  • colspan – Number of columns that the cell is to span.
  • rowspan – Number of rows that the cell is to span.
  • headers – The header cells for the cell.

Content

Within a <td> flow content is supported.

Learn More

Did you know? A <td> element’s end tag (</td>) can be omitted if the <td> element is immediately followed by a <td> or <th> element, or if there is no more content in the parent element.


This content originally appeared on Envato Tuts+ Tutorials and was authored by Andy Leverenz


Print Share Comment Cite Upload Translate Updates
APA

Andy Leverenz | Sciencx (2023-02-10T12:45:29+00:00) HTML Element: td. Retrieved from https://www.scien.cx/2023/02/10/html-element-td/

MLA
" » HTML Element: td." Andy Leverenz | Sciencx - Friday February 10, 2023, https://www.scien.cx/2023/02/10/html-element-td/
HARVARD
Andy Leverenz | Sciencx Friday February 10, 2023 » HTML Element: td., viewed ,<https://www.scien.cx/2023/02/10/html-element-td/>
VANCOUVER
Andy Leverenz | Sciencx - » HTML Element: td. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2023/02/10/html-element-td/
CHICAGO
" » HTML Element: td." Andy Leverenz | Sciencx - Accessed . https://www.scien.cx/2023/02/10/html-element-td/
IEEE
" » HTML Element: td." Andy Leverenz | Sciencx [Online]. Available: https://www.scien.cx/2023/02/10/html-element-td/. [Accessed: ]
rf:citation
» HTML Element: td | Andy Leverenz | Sciencx | https://www.scien.cx/2023/02/10/html-element-td/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.