Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can a td be inside a td

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...

like image 883
Shaoz Avatar asked Sep 20 '11 12:09

Shaoz


People also ask

Can I put a div inside a TD?

One important thing to remember when putting a div inside of a table is that the div needs to live inside of a particular table cell, meaning inside of a td or th element which is inside of a tr element. This can help with using absolute positioning inside of table cells as well.

Which tags can be used within a table cell TD?

You will place cell tags <td> within each of the <tr> tags. You will have a <tr> tag for each row within your table and within each <tr> tag, you will have a set of <td> tags to determine the columns. Attributes for the <tr> tag: align - This establishes how the content of each row's cells are aligned.

Does TD need to be in TR?

Yes, you need <td> . Browsers will still try to render the table if you write invalid HTML, but the rendering will be inconsistent between browsers. <th> can take the place of <td> if the cell is a header cell. It does not take the place of <tr> which is always required.

Can we use table inside table?

Tables can be nested together to create a table inside a table. To create a nested table, we need to create a table using the <table> tag. This table is known as the outer table. The second table that will be nested table is called the inner table.


1 Answers

not directly but you could place table inside td

<td class="parent">
   <table><tr>
    <td class="child">
        <!-- Some info -->
    </td>
   </tr></table>
</td>
like image 140
i100 Avatar answered Sep 19 '22 11:09

i100