I am trying to create a dynamic popup that can be resized. However, since I cannot use static widths, I am having problems using floats and percent for widths.
When I specify the percentage for the width of the floating div, it assumes that I mean the 100%
width of the containing div. What I'm trying to do is set the width to the rest of the width of the current div. If I use a table, it will work. Essentially, I need to be able to use the following code for a table and make it work with a div ...
<table style="width: 100px;" cellpadding="0" cellspacing="0">
<tr style="height: 25px;">
<td style="width: 10px; background-color: Red;"></td>
<td style="background-color: Blue;"></td>
<td style="width: 10px; background-color: Black;"></td>
</tr>
</table>
Shows the following:
I have the following so far, but it does not work as intended ...
<div id="container" style="width: 100px; height: 25px;">
<div id="left" style="float: left; width: 10px; background-color: Red; height: 100%;"></div>
<div id="mid" style="float: left; background-color: Blue; height: 100%;"></div>
<div id="right" style="float: right; width: 10px; background-color: Black; height: 100%;"></div>
</div>
The code above shows the following:
Anyway, if someone can help me translate the table method into something that will work with the div, I would appreciate it.
Thanks,
C
The note:I tried adding the code to the actual post, but it looks like the message is not interpreting html. Therefore, the sections that say “shows the following” do not actually do this.
regex source
share