I need to have a table with rows with a fixed height, and the table itself should have a fixed height. For example, all rows will have a height of 8 pixels, and the table will have a height of 400 pixels. If there are fewer rows than the total height of the table, the rest of the table should be like a gap.
But css automatically reconfigures the row height if I set a fixed height in the table.
I need a table to look like this:
|row |cont | |row |cont | |row |cont | | | | | | | |End of table|
I tried this:
CSS
.t-table { border: 1px solid black; height: 400px; border-collapse: collapse; } td { border: 1px solid black; }
HTML:
<table class="t-table"> <tr style="line-height: 8px"> <td>A</td> <td>B</td> </tr> <tr style="line-height: 8px"> <td>1</td> <td>2</td> </tr> <tr> <td></td> <td></td> </tr> </table>
Or you can check it here: https://jsfiddle.net/utrwqfux/
PS Therefore, if I force the height on the table, it ignores the height of the lines. The last tr was without height, so the idea was to automatically resize the filling space.
source share