Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table within a table - proportions not working on initial load

Status
Not open for further replies.

monsdrum

Technical User
Nov 16, 2002
4
DK
Hi guys

I have this problem that is recurring through 3 websites I've made so far, so I'd really like to solve it by now. Here goes;

I made a table cell for the contents of the site. The dimensions of this cell is determined by css through a definition of the DIV parameter, looking like this:

DIV {
overflow: auto;
height: 230px;
width: 600px;
}

This works as intended; as soon as the contents are too large for the cell, a scrollbar appears - neat. The exception is: if I put too much content in there, the cell is stretched to become way too long the first time the page is loaded in IE - if you refresh, the page will load OK. This especially happens if I put a long table into the cell. Here are a few examples:



How can I fix this so that the page will load correctly on first try? Hope that someone will be able to give me the right clue.

Any help will be much appreciated - TIA.

regards

David Mondrup
 
Hi David,

I also had this problem before.
With me it was an image that was loaded into a DIV that would come out all wrong unless it was refreshed.

the solution I found was to pre-load the image. Apparently it is a problem with the browser deciding what size and shape to make the <div> before it gets all of the contents.

I'm not sure how you can use that knowledge. Perhaps you can resize the DIV after the page loads to ensure it stays the correct size.

you could use:
<body onLoad=&quot;SizeStuff();&quot;>

and make the function to size everything as it should be.

I hope that helps.



Travis Hawkins
BeachBum Software
travis@cfm2asp.com
 
Just shooting from the lip here, but have you tried just putting the raw text in your DIV without surrounding the whole thing in a table? You should be able to apply the CSS directly to the <div> element shouldn't you?

Don't know if it will fix your problem though. What version of IE is giving you the problem?

-- Chris Hunt
Extra Connections Ltd

The real world's OK for a visit, but you wouldn't want to LIVE there!
 
Thanx for your replies - much appreciated.

re the body onload tag; I'll have to investigate further how to use that - I'll search the forums as well as google myself for a tutorial, but if you should happen to know a rl example of this to investigate, any pointer in that direction would be appreciated.

re doing the thing without tables; right away I'd say I can't do the text/image formatting in tehse pages without tables or something like it, but on second thoughts I may be wrong - I'll have to give it a go.
The monsdrum.com website has been checked in IE 4, 5 & 6, netscape 7 (or whatever's current - I don't use it for anything but checking compatibility) and Mozilla. The same prob everywhere ...

Again, thanx for your answers. All further ideas are much welcome.

regards

David Mondrup
 
div is the spawn of satan i hate div, always have, always will. where div is 100% necessary... use span, otherwise dont use anything! div is evil and will cause the apocalypse. remove all div tags from your site as they are evil and will change your content to vulgar images and words. Code at first, then the displayed content. Then it'll eat the code and leave <html><body><div><div><div>...
div is evil. destroy div. div was the reason you found out about santa, div was the reason hitler was a bastard div is the reason why there is tax on everything. div is not the reason why there is life, div is not the reason why there is love div is not good.
div is a foul fiend that should be removed from every page script and put into a tempory text file, printed off and that document sent into the sun. That computer should also be taken with it. Bleach must be used on all the coax cables in the world for they may be contaminated with div. Ppl who remember div must be hypnotised and this thread must be deleted!

DIV IS EVIL DO NOT USE IT!

~*Gwar3k1*~
&quot;To the pressure, everything's just like: an illusion. I'll be losing you before long...&quot;
 
I feel i must appologise. Its 1.44am, ive been drinking sugar free coke and ive had bad experiences with div so i dont like it so much =(

You should use span where you need to use div. it works in the same way (ish) but doesnt force a carrige return

~*Gwar3k1*~
&quot;To the pressure, everything's just like: an illusion. I'll be losing you before long...&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top