Leo Loki Leo Loki - 22 days ago 14
CSS Question

Wrap table row to the next line

<table id="table_id">
<tr>
<td>testtesttesttest</td>
<td>testtesttesttest</td>
</tr>
</table>


I would like that if the table does not fit on the screen, then to the second cell of the table will be transferred to another row down? Not the text in the cell, but the whole cell.

Answer

Change the cells to inline blocks:

#table_id  { display: block; }
#table_id  td {display: inline-block; }

jsfiddle

Comments