I specified my HTML table to have a min-height: 50%
and min-width: 60%
, but as you can see my table size does not reflect this. It seems to have sized to be just big enough to contain its child element. Can someone explain why this behavior occurs when I expect my table to the specified height and width?
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: Tahoma, Geneva, Verdana, sans-serif;
}
#wrapper {
border: 3px solid black;
height: 100vh;
width: 100vw;
}
.table {
border: 3px solid red;
min-height: 50%;
min-width: 60%;
margin: 10% auto;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div id="wrapper">
<table class="table">
<thead>
<tr>
<th>name</th>
<th>age</th>
<th>grade</th>
<th>percentage</th>
<th>passing</th>
<th>notes</th>
</tr>
</thead>
</table>
</div>
</body>
</html>