gib65
03-02-2015, 11:31 PM
Please have a look at the following html:
<html>
<head>
</head>
<body style="width: 100%;">
<table style="width: 100%;" border=1><tr><td>
<div style="width 50%; background-color: red; float: left;">left</div><div style="width: 50%; background-color: blue; float: left;">right</div>
</td></tr></table>
</body>
</html>
When I run this, I get a red div with the word "left" in it that's only about an inch long, and I get the blue div right after it at about 50% of the page.
Why is the red div not 50% of the page?
<html>
<head>
</head>
<body style="width: 100%;">
<table style="width: 100%;" border=1><tr><td>
<div style="width 50%; background-color: red; float: left;">left</div><div style="width: 50%; background-color: blue; float: left;">right</div>
</td></tr></table>
</body>
</html>
When I run this, I get a red div with the word "left" in it that's only about an inch long, and I get the blue div right after it at about 50% of the page.
Why is the red div not 50% of the page?