...

View Full Version : getting fieldset to take up 100% height of table cell



bonecone
04-14-2011, 05:45 PM
How do I force my fieldset to take up 100% of the height of the table cell it's in?

bullant
04-15-2011, 08:27 AM
To set a % height on an element, all of its parent elements must have a height set on them.

Maybe use this demo as a guide.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title></title>
<style type="text/css">
html,body {
height: 100%;
}
fieldset {
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
border: 2px solid red;
}
#table1 {
height: 300px;
}
#table1 tr, #table1 td {
height: 100%;
}
#table1 td fieldset {
height: 100%;
}
</style>
<script type="text/javascript"></script>
</head>
<body>
<table id="table1" border="1" cellspacing="0">
<tr>
<td>
<fieldset>
<input type="text" name="txt1" />
</fieldset>
</td>
<td>line 1<br />line 2<br />line 3<br />line 4<br />line 5<br />line 6</td>
</tr>
</table>
</body>
</html>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum