Link to home
Start Free TrialLog in
Avatar of alfardan
alfardanFlag for United Arab Emirates

asked on

Table doesn't take height of 100%, why?

Hello

Please check the attached html code, why doesn't table1 strech to fill the complete space of the <td> that contains it? How do I let it strech 100% of it to have the same height as that of table2?
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<div align='center'>
	<table border='0' cellpadding='0' style='border-collapse: collapse' align='center'>
		<tr>
			<td valign='top'>
 
				<table name='table1' border='1' cellpadding='0' style='border-collapse: collapse' align='center' height=100%>
					<tr height=100%>
						<td valign='top' height=100%>TESTING 1 2 3<td>
					</tr>
				</table>
 
			</td>
			<td style='padding-left: 10'></td>
			<td valign='top'>
 
				<table name='table2' border='1' cellpadding='0' style='border-collapse: collapse' align='center' height=100%>
					<tr height=100%>
						<td valign='top' height=100%>TESTING 1 2 3<br>TESTING 1 2 3<br>TESTING 1 2 3<br>TESTING 1 2 3<br><td>
					</tr>
				</table>
 
			</td>
		</tr>
	</table>
</div>
</body>
</html>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of zlobcho
zlobcho
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
since HTML 4.0 you're not supposed to assign a height to the table element. Instead use CSS to adjust the height of the table. Also, you need to assign a height to the td tag so the table knows what 100% is.




<table border='0' cellpadding='0' style='border-collapse: collapse' align='center'>
<tr>
<td valign='top' height="100%">
<table name='table1' border='1' cellpadding='0' style='border-collapse: collapse; height:100%;' align='center'>
<tr>
<td valign='top' bgcolor="#333">TESTING 1 2 3
<td> 

Open in new window

SOLUTION
Avatar of coolersport
coolersport
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of alfardan

ASKER

Thanks to you all