Log in

View Full Version : Table Height Problem



Sarin
07-11-2010, 01:34 AM
Hey all. I have an iframe within a table and the iframe's height is set to 100%. Basically what I want to achieve is the table to follow the size of the iframe. But I can't seem to figure it out.

www.nageckos.com

Basically if the IFRAME only has, say, 200px worth of content, I want the table to only be 200px high. If I have a lot of text/pictures, I want the table's height to adjust itself accordingly.

Feel free to view my HTML to see if I am doing anything wrong.

Thanks!

Sarin
07-11-2010, 01:31 PM
Anyone? :)

djr33
07-11-2010, 03:24 PM
This sounds difficult. For one thing, the iframe's information may not be available on the parent page, so the table won't know what to do.
Another issue is that tables can create problems when used for layouts, so you might find it easier to work with divs.

You could use Javascript to try to adjust this, but that would be both difficult and unreliable. I'm sure there's a way to do it, though.

The only other way that I can think of is this: do not set a height to the table. Instead, set max-height in the CSS. That way you will let it only get to be 200px, or whatever you want, but the content will otherwise determine it (anywhere from 0px to 199px-- then after 200px it can't get any bigger).
That seems like an ideal solution (if everything works smoothly, since I haven't tested it), but the main problem with this is that Internet Explorer doesn't use max-height, so it won't do anything in there.

Sarin
07-11-2010, 05:09 PM
See, the reason why I don't just get rid of the iframe is because I have my domain through another company and it is simply masking the website. If I just link to another page, the address bar will go from www.nageckos.com to www.nageckos.webs.com/available.html etc. Which is too unprofessional to me. Is there any way I can change this?

djr33
07-11-2010, 09:52 PM
Yes, actually use your domain on your hosting server. I know that's obvious and may be difficult, but if you want a real and "professional" website, there's nothing stopping you from paying $5/month for real hosting and this won't be a problem. $5/month is the low end of hosting, but I'm sure you can find something better than your free host now.

My suggestions above should still help-- try using max-height, and if you can, avoid using tables in the layout.

But to get a "professional" site, you will need to actually create a professional site-- not one that is just pretending to be a real site.
I don't mean this to sound harsh or anything, but it's the truth, and it's entirely your choice what you want your visitors to see.
For example, at the moment your site doesn't display anything in the address bar when you go to a new page. That means we can't bookmark a page, can't link a friend to another page, and it also doesn't look professional. To a novice web user it may not be relevant or noticeable, but to someone who does web design (even a little), that's obviously a way to hide the sort of dual hosting setup you're using. It's pretty common, but I wouldn't call it professional.

Sarin
07-12-2010, 09:33 PM
Thanks for the reply. I have decided to transfer my domain and email to my hosting company. Hopefully when it's all said and done life will be a little easier. LOL.

I have another question concerning the background, but I will make a new post for that.

Thanks again. :)