Getting table cells to wrap horizontally
Hey guys, I'm trying to create a table with the following behavior:
- Cells of different widths in a column should align
- The last cell, with
width: "100%"
should fill the remaining space available
- The cells should wrap to the next row when there's not enough space remaining in the viewport.
To get the cells to wrap to next row, the only solutions I've found were to set the display
property of <tr>
or <td>
to something else like display: inline-block
or display: flex
, however by doing this, we lose first two behaviors that comes by default with display: table-row and display: table-cell
.
If anyone has an idea on how to achieve all 3 behaviors it'll be greatly appreciated.
Sample code:
0 Replies