Is it permissible to put h3 (or any header) inside td tags?

The question is asked by TH tags, but I could not find them for TD tags.

Can headers be tagged <td>?

+4
source share
2 answers

theadnot h3, if you use the element h3inside td, this is absolutely normal, but if you use h3, since the direct child in tris invalid.

To use thead, you can use it as follows

<table>
   <thead>
      <tr>
         <th>This is table head and not h3</th>
      </tr>
   </thead>
   <tfoot>
      <tr>
         <td>Foot Cell</td>
      </tr>
   </tfoot>
   <tbody>
       <tr>
          <td>
             <h3>It completely valid to put your h3 here</h3>
             Table cell
             <p>You can also use p tag here
           </td>
       </tr>
   </tbody>
</table>

But if you do something like this, it’s not valid

<table>
   <tr>
      <h3>It invalid</h3>
      <td>This is a cell</td>
   </tr>
</table>

Strike>

, .

+5

. td, .. <td> ( ) </td>, - ". , . , h3.

th , td HTML4, HTML5 CR, , , .

tr ( ) th td, , th td.

, , . , th ( < th ), td (, , ).

+4

All Articles