Content between rows in html table

I need to have a table in which each row can have a child table or other content below that row.

Is there any correct way to do this?

+5
source share
4 answers

Add another one <tr>after the current c colspan, which covers all the columns, and then places another <td>c in it <table>.

<tr>
    <td>col1</td>
    <td>col2</td>
    <td>col3</td>
</tr>
<tr>
    <td colspan="3">
        <table>...</table>
    </td>
</tr>
<tr>
    <td>col1</td>
    <td>col2</td>
    <td>col3</td>
</tr>

A new table will appear between the rows.

+7
source
<table>
    <tbody>
        <tr>
            <td>
                <table>
                    <tbody>
                        <tr>
                            <td>
                                 problem?
                            </td>
                        </tr>
                    </tbody>
                </table>
            </td>
        </tr>
    </tbody>
</table>
+6
source

- , .

colspan, , , .

<table>
  <tr>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td colspan="3"></td>
  </tr>
</table>
+2

There is no valid way. Only td-s and th-s are allowed in tr. However, you can put only 1 td per row and set the colspan attribute to the number of columns that you have in the table.

+1
source

All Articles