![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
You don't want http://netweaver.com.au/test/howa.html OK. The Dorayme Factory has 2 more offerings for you: http://netweaver.com.au/test/howa2.html http://netweaver.com.au/test/howa3.html You gotta like one of these, I have them on special till midnight tonight. (I am a bit unknowing about what you quite want... but anyway. I am here on earth to help the poor, the sick, the immigrants, and all who have fallen on hard times...) -- dorayme Thank you very much. But still, my problem is: I don't want to specify the width of my header, I want it to `auto width`, in which, consistent with the table width (this can be changed). Thanks again. |
#2
| |||
| |||
|
|
About divs, they are by default 100% wide. Anyway, how about http://netweaver.com.au/test/howa5.html dorayme |
#3
| |||
| |||
|
|
On 10 22 , 2 52 , dorayme <doraymeRidT... (AT) optusnet (DOT) com.au> wrote: About divs, they are by default 100% wide. Anyway, how about http://netweaver.com.au/test/howa5.html dorayme Thank you again. This is exactly the example I given above - the div is 100% to the current browser view port (try to resize the browser), but the table is in overflow. What I want is: If there are any objects (e.g. table) in the remaining of the page make the browser to overflow with horizontal scrollbar, let make the header also has the full width of that object. |
#4
| |||
| |||
|
|
In my example the table width is fixed at 1240px. No more and no less. If the browser window is not wider than 1200 or so, you cannot see the end of the table, you get a horizontal scrollbar. That is what you want, you say? dorayme |
#5
| |||
| |||
|
|
On 10 22 , 3 38 , dorayme <doraymeRidT... (AT) optusnet (DOT) com.au> wrote: In my example the table width is fixed at 1240px. No more and no less. If the browser window is not wider than 1200 or so, you cannot see the end of the table, you get a horizontal scrollbar. That is what you want, you say? dorayme Thanks again. Maybe I am not clear, to make it simple, I would say: In the http://netweaver.com.au/test/howa5.html, If the table width is 1204px, I want the header also has 1204 width, If the table has 9999px width, I also want the header to have this full width, not 100% of the current visible width of the browser. (But I don't want to hard code the value as the header width, also I want to keep the existing structure) (p.s. I am using FF 2.0) Thanks. |
#6
| |||
| |||
|
|
On 10 22 , 3 38 , dorayme <doraymeRidT... (AT) optusnet (DOT) com.au> wrote: In my example the table width is fixed at 1240px. No more and no less. If the browser window is not wider than 1200 or so, you cannot see the end of the table, you get a horizontal scrollbar. That is what you want, you say? dorayme Thanks again. Maybe I am not clear, to make it simple, I would say: In the http://netweaver.com.au/test/howa5.html, If the table width is 1204px, I want the header also has 1204 width, If the table has 9999px width, I also want the header to have this full width, not 100% of the current visible width of the browser. |
#7
| |||
| |||
|
|
How about this: div style="float: left" div style="border: 2px solid red">header</div table style="width: 1240px; border: 2px solid green" tr td>sss</td /tr /table div style="clear: left"></div /div |
#8
| |||
| |||
|
|
The reason for wrapping everything in a float is that a float has shrink-to-fit width, or in this case, stretch-to-fit width: it will be made wide enough for its contents, in other words, wide enough for that huge table. The header gets its width from its container, which is that stretched-out float. I put the clearing div in at the end just to be safe, so subsequent things won't go to the right of the float for people with viewports wider than 1240px. |
#9
| |||
| |||
|
|
On 10 22 , 5 06 , Ben C <spams... (AT) spam (DOT) eggs> wrote: The reason for wrapping everything in a float is that a float has shrink-to-fit width, or in this case, stretch-to-fit width: it will be made wide enough for its contents, in other words, wide enough for that huge table. The header gets its width from its container, which is that stretched-out float. I put the clearing div in at the end just to be safe, so subsequent things won't go to the right of the float for people with viewports wider than 1240px. One more follow up, if my header is also using table (not div), is it possible to do the same thing? |
#10
| |||
| |||
|
|
That's what you should get with the markup above. Works for me in Firefox, Opera and Konqueror. What browser or browser-shaped-object are you testing this in? |
![]() |
| Thread Tools | |
| Display Modes | |
| |