We would like to know how to make table strech with div.
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
#test {<!--from ww w . ja va 2 s. com-->
width: 40%;
height: 50%;
background-color: #EEE;
}
#table {
border: 1px solid green;
width: 100%;
}
</style>
</head>
<body>
<div id="test">
123
<table id='table'>
<tr>
<td>
<p>1234</p>
</td>
<td>
<p>1224</p>
</td>
</tr>
<tr>
<td>
<p>1234</p>
</td>
<td>
<p>1224</p>
</td>
</tr>
</table>
</div>
</body>
</html>
The code above is rendered as follows: