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

BjHutchAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
B_DorseyConnect With a Mentor Commented:
This work?
<div style="width:100%">
 <div style="float:right;width:200px;background-color:#ccc">dsfdsf</div>
 <div style="width:200px;background-color:#ccc;float:left">dsfdsf</div>
 <div style="margin:0px 200px 0px 200px;background-color:#ff0000">
  <div style="width:100%">
   <table width="100%" border="1">
    <tr>
     <td>&nbsp;</td>
    </tr>
   </table>
  </div>
 </div>
 <div style="clear:both"></div>
</div>

Open in new window

0
 
BjHutchAuthor Commented:
Yes, that works great!  Thank you again.
0
All Courses

From novice to tech pro — start learning today.