Wrap table row to the next line

Change the cells to inline blocks:

#table_id {
  display: block;
}

#table_id td {
  display: inline-block;
}

td {
  background: green
}
<table id="table_id">
  <tr>
    <td>testtesttesttest</td>
    <td>testtesttesttest</td>
  </tr>
</table>

jsfiddle

Leave a Comment