max-height: ***; min-height: ***;
Browser |
|
---|
The max-height property specifies the maximum height of an element, and the min-height property specifies the minimum height of an element.
The maximum height and minimum height of the table can be specified by applying these properties to the TABLE element.
table {
max-height: 350px;
min-height: 250px;
}
Property | Value | Explanation |
---|---|---|
max-height | length, %, or none | the size of the maximum height (the default is none) |
min-height | length or % | the size of the minimum height (the default is 0) |
Example
<html>
<head>
<title>TAG index</title>
<style type="text/css">
table {
border: 2px #2b2b2b solid;
width: 600px;
height: 100%;
max-height: 500px;
min-height: 300px;
}
td, th {
border: 2px #2b2b2b solid;
text-align: center;
}
</style>
</head>
<body>
<table>
<tr>
<th>minimum height:300px - maximum height:500px</th>
</tr>
<tr>
<td>Return</td>
</tr>
</table>
</body>
</html>
- Output
-
Example page