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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

B_DorseyCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
BjHutchAuthor Commented:
Yes, that works great!  Thank you again.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.