HTML <td> tag

By Jonathan Griffin. Editor, SEO Consultant, & Developer.

· 2 min read


A <td> element represents a standard data cell in a table.


  <caption>This is the table's caption</caption>
            <th colspan="2">The table header with one column</th>
            <td>The table body</td>
            <td>with two columns</td>


  • An opening tag is required.
  • An end tag 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.
  • A <td> element must be a child of a <tr> element.
  • The text in a <td> cell is left-aligned by default.


The <td> element supports the Global Attributes, along with the following:

  • colspan

    The colspan attribute specifies the number of columns that the cell should span.

  • headers

    The headers attribute allows you to assign one or more headers to a particular cell. The header attibute value corresponds to the id attribute of the <th> elements.

        <th rowspan="2" id="h">Homework</th>
        <th colspan="3" id="e">Exams</th>
        <th colspan="3" id="p">Projects</th>
        <th id="e1" headers="e">1</th>
        <th id="e2" headers="e">2</th>
        <th id="ef" headers="e">Final</th>
        <th id="p1" headers="p">1</th>
        <th id="p2" headers="p">2</th>
        <th id="pf" headers="p">Final</th>
      <td headers="h">15%</td>
      <td headers="e e1">15%</td>
      <td headers="e e2">15%</td>
      <td headers="e ef">20%</td>
      <td headers="p p1">10%</td>
      <td headers="p p2">10%</td>
      <td headers="p pf">15%</td>

  • rowspan

    The rowspan attribute specifies the number of rows that the cell should span.


Browser Support




Android WebviewChrome AndroidFirefox AndroidOpera AndroidiOS SafariSamsung Internet