Link to home
Start Free TrialLog in
Avatar of BjHutch
BjHutchFlag for United States of America

asked on

How do I place a 100% width table within a div and have it change the div width

I have a div layout where I want to put a table in the middle div.  I want this table to be 100% width and height so that it completely fills up the div.  What is the best way to do this?

I have added the code I have so far.  It currently stretches out the div or will place the table below it.

Thank you for your reply.
<div style="width:100%">
 <div style="float:right;width:200px;background-color:#ccc">dsfdsf</div>
 <div style="float:left;width:200px;background-color:#ccc">dsfdsf</div>
 <div style="background-color:#ff0000">
 
<table width="100%%" border="1">
  <tr>
    <td>&nbsp;</td>
    </tr>
</table>
 
 </div>
 <div style="clear:both"></div>
</div>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of B_Dorsey
B_Dorsey

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 BjHutch

ASKER

Yes, that works great!  Thank you again.