PDA

View Full Version : table height 100% not working



soulfly
Apr 5th, 2007, 12:19 PM
Hi everyone,
I've set the table height to 100% but it's not reflecting on the page. I'm using Strict DTD.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">


But when I remove the above code and simply put <html> it works. This is not what I want. I want to include the DTD Strict 1.0 and at the same time want the table to extend 100%.

Any help is highly appreciated.

Thanks in advance.

Regards,
Soulfly

VIPStephan
Apr 5th, 2007, 12:28 PM
Have you tried html, body {height: 100%;} in addition to your styles?

soulfly
Apr 5th, 2007, 01:02 PM
Hi Stephan,
Thx 4 the prompt reply. Does this mean that it's going to apply to all the elements of the page?

I just need to get the table height to 100% and is this cross-browser compatible?

Thanks.

Regards,
Soulfly

VIPStephan
Apr 5th, 2007, 01:47 PM
Does this mean that it's going to apply to all the elements of the page?
No, that means you make the html and body elements 100% high because this is what the table (if direct child of body) is referring to when you set a relative height. Put a border around the body and youíll see that itís by default not 100% high.


I just need to get the table height to 100% and is this cross-browser compatible?
Donít ask, just try!

soulfly
Apr 10th, 2007, 08:41 AM
Hi VS,
I've tried a couple of things and it's working well.

Thanks a lot.

Regards,
Soulfly