Table height 100%

This is a discussion on "Table height 100%" within the Web Page Design section. This forum, and the thread "Table height 100% are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Sep 26th, 2007, 12:51
New Member
Join Date: Sep 2007
Location: India
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Table height 100%

Hi All,

In html if we write without "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
" at the top of your html code

<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td align="left" valign="top" style="background:#ff0000">this is a test</td>
</tr>
</table>


then, the table will cover the whole browser area.

but if you paste the same table code with "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
" at the top of your html code

then the table will take height of only its content.

Can you tell me how to make table height matching browser height along with at the top of html code written "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">"


Regards
Subha
Reply With Quote

  #2 (permalink)  
Old Sep 26th, 2007, 13:26
welshstew's Avatar
Lead Administrator

SuperMember
Join Date: May 2007
Location: inside the outside
Posts: 1,388
Blog Entries: 13
Thanks: 1
Thanked 17 Times in 15 Posts
Re: Table height 100%

Subha,

It's not that the browser isn't recognising ro ignoring the height attribute, it's that when you are in a standards compliance mode, it's expanding it to 100% height of the html and body area.

In order to fix this you can add the following code:

Code: Select all
html,body{
      margin:0;
      padding:0;
      height:100%;
      border:none
   }
Your table should expand to the height you then set.

Stew

P.S why not switch to CSS tabless design, much nicer.....
__________________
WelshStew
Lead Administrator

tierney rides tboard - uk site | xtreme wales - extreme clothing
If you think I've helped, click the "Thanks"
webforumz - facebook | LinkedIn
Last Blog Entry: Web Standards Curriculum Launched (Jul 8th, 2008)
Reply With Quote
  #3 (permalink)  
Old Sep 26th, 2007, 13:43
AdRock's Avatar
SuperMember

SuperMember
Join Date: Jul 2006
Location: Devon, England
Posts: 565
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to AdRock
Re: Table height 100%

Quote:
Originally Posted by welshstew View Post
Subha,

It's not that the browser isn't recognising ro ignoring the height attribute, it's that when you are in a standards compliance mode, it's expanding it to 100% height of the html and body area.

In order to fix this you can add the following code:

Code: Select all
html,body{
      margin:0;
      padding:0;
      height:100%;
      border:none
   }
Your table should expand to the height you then set.

Stew

P.S why not switch to CSS tabless design, much nicer.....
And easier to manage
Reply With Quote
  #4 (permalink)  
Old Sep 26th, 2007, 14:08
New Member
Join Date: Sep 2007
Location: India
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Table height 100%

Thank you welshstew,

The problem is solved with IE, my purpose is solved, thanks a lot.

But in firefox it is not working.

Regards
Subha
Reply With Quote
  #5 (permalink)  
Old Sep 26th, 2007, 14:15
welshstew's Avatar
Lead Administrator

SuperMember
Join Date: May 2007
Location: inside the outside
Posts: 1,388
Blog Entries: 13
Thanks: 1
Thanked 17 Times in 15 Posts
Re: Table height 100%

weird works for me.

can you post a link of the code to have a look.
__________________
WelshStew
Lead Administrator

tierney rides tboard - uk site | xtreme wales - extreme clothing
If you think I've helped, click the "Thanks"
webforumz - facebook | LinkedIn
Last Blog Entry: Web Standards Curriculum Launched (Jul 8th, 2008)
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to constrain the height of a dynamic table MrQuestions Web Page Design 3 Mar 15th, 2008 00:08
How to make a table height equal to the browser height ? subhadip Starting Out 4 Sep 20th, 2007 07:56
Problems with height in a table-row element llpamies Web Page Design 3 Aug 9th, 2007 18:02
Table Height 100% only when refreshed…. mrunclesam Web Page Design 9 Dec 22nd, 2006 15:05
100% Table Height Problems joshcxa Web Page Design 5 Aug 3rd, 2005 03:12


All times are GMT. The time now is 23:39.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43