Basically, i would like to have a min-height for my table, so that responsively it can adjust at it's own means. This works beautifully in chrome but it really doesn't like FireFox, tried the display:block; but that makes things worse on chrome.
Thanks.
.table-wrap {
min-height: 323px;
}
table {
width: 100%;
min-height: 323px;
}
table tr {
min-height: 54px;
}
To set the row height to a specific measurement, click a cell in the row that you want to resize. On the Layout tab, in the Cell Size group, click in the Table Row Height box, and then specify the height you want. To use the ruler, select a cell in the table, and then drag the markers on the ruler.
The height of rows 'tr' in a table can be fixed very easily. This can be done by adding the height attribute in the tr tag. If the height is not specified, the height of the row changes according to the content. The height can be specified either in pixels, or percentage.
Set a row to a specific height Select the row or rows that you want to change. On the Home tab, in the Cells group, click Format. Under Cell Size, click Row Height. In the Row height box, type the value that you want, and then click OK.
The min-height CSS property sets the minimum height of an element. It prevents the used value of the height property from becoming smaller than the value specified for min-height .
change table's min-height to height. if the content is higher, table will be enlarged anyway
Add height: 0
and that will make Firefox take the min-height
The effect of min-height
property is not defined for tables, table rows and table cells.
See: http://www.w3.org/TR/CSS21/visudet.html#min-max-heights
Suppose your markup looks like the following HTML:
<div class="table-wrap">
<table>
<tr>
<td>Cell 1 Donec ipsum libero...</td>
</tr>
<tr>
<td>Cell 2</td>
</tr>
</table>
</div>
Now, consider the following CSS:
.table-wrap {
min-height: 323px;
border: 1px dotted blue;
}
table {
width: 400px;
height: 323px;
border: 1px dashed red;
}
table tr {
height: 54px;
}
table td {
border: 1px dotted red;
}
In this case, the table will have a minimum height of 323px, and this height will be distributed among the various rows in the table depending on the details of the content in each row's table cells.
At the very least, each row will be at least 54px in height.
If you have many rows with short cells (less than 54px in height), then eventually the table height will adjust to accommodate the rows.
If the table has only a few rows with short cells, then the rows will increase in height to fill up the table's height of 323px.
The .table-wrap
parent element does not have any effect on the height of the table in this case.
See fiddle at: http://jsfiddle.net/audetwebdesign/zMtBu/
Unfortunately specifically with Firefox this is a bug: https://bugzilla.mozilla.org/show_bug.cgi?id=307866
min-height: [whatever]
will not play well with
display: table
The only alternative is to use a fixed height.
Case closed
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With