Can a td be inside a td

32,167

Solution 1

not directly but you could place table inside td

<td class="parent">
   <table><tr>
    <td class="child">
        <!-- Some info -->
    </td>
   </tr></table>
</td>

Solution 2

No, <td> may not be a child of a <td>. A <td> may only be a child of a <tr>.

Share:
32,167
Shaoz
Author by

Shaoz

Updated on July 09, 2022

Comments

  • Shaoz
    Shaoz almost 2 years

    It may be a nonsense question, and I know we have to follow standards as much as possible. But can <td> be a direct child of another <td>, like this:

    <td class="parent">
        <td class="child">
            <!-- Some info -->
        </td>
    </td>
    

    Or it's obligatory to create another <table> with a new <tr> before adding the <td>, which can become heavily populated with table tags and become clustered...

  • Chris G.
    Chris G. over 12 years
    You could also put a div inside a <td> and it would be slightly less heinous.