[thelist] Width of Parent DIVs depending on Child DIV - yes and no?

Stefan Schwarzer st.schwarzer at geois.de
Thu Feb 15 02:21:12 CST 2007

Hi there,

I have a problem with my DIVs... In principal everything worked fine.

But now I am trying to insert in the middle of the page a DIV which  
holds a table with sometimes many rows and different sizes of the  
columns. The aim is to have a scrolling possibility within the DIV,  
so that one does not need to scroll the whole page...

The thing is that in this case the width of all "parent DIVs" should  
depend on the width of the DIV which holds the table.  And that is  
not always 100%.

So, it looks something like this:

<div id="1" class="contentBox">
	something here
	<div id="2" style="some fill color">
		something here
		<div id="3">
			table here, sometimes 300px wide, sometimes 1200px wide

#contentBox {
     display: block;
     position: relative;
     width: 100%;

So, the DIV id="2" should in many cases not be 100%, but should be as  
wide as DIV id="3"...

Any possibility to achieve this?

Thanks for any hints!


More information about the thelist mailing list