Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
table 100% width & height
Old 03-20-2006, 07:28 PM table 100% width & height
jyoz22's Avatar
Ultra Talker

Posts: 278
Location: Orlando, FL
Trades: 0
i'm trying to make a site using a table as the container basically, i need it to be exactly 100% of the screen width and heigth.

If i do <table width="100%" height="100%">

the width works but not the height. what can i do about the height?
----------------------------
also i know that topmargin="0", leftmargin="0", rightmargin="0", and bottommargin="0" those work on IE, and a few other browsers but not all.

if i did this:

<table style="width:100%; height:100%; position:absolute; top:0px; left:0px; right:0px; bottom:0px;">

do you think that would work on all browsers?
jyoz22 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-20-2006, 07:38 PM Re: table 100% width & height
Defies a Status

Posts: 1,606
Trades: 0
I can't answer the browser part.

The 100% width should resize for the popular browsers.

The 100% height is different. The height of any table is controlled by the content wihin the table. When the content stops so does the table. One can cheat by using a series of <br> if blank space is desired. If there is another way I am not aware of it.

Colbyt

Last edited by colbyt; 03-20-2006 at 07:41 PM..
colbyt is offline
Reply With Quote
View Public Profile
 
Old 03-20-2006, 07:42 PM Re: table 100% width & height
jyoz22's Avatar
Ultra Talker

Posts: 278
Location: Orlando, FL
Trades: 0
no, i don't want to use <br>'s that messes up in each screen resolution, the 800x600 screens would just have a whole bunch of blank space.
jyoz22 is offline
Reply With Quote
View Public Profile
 
Old 03-20-2006, 08:00 PM Re: table 100% width & height
amygdela's Avatar
Super Talker

Posts: 111
Trades: 0
You can make the table 100% in height and width with CSS, but the 100% height of the table must be related to another 100% height, and for that we use the <body> tag.

body {
height: 100%;
margin: 0;
padding: 0;
background: #FFF;
}
#myTable {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}

<body>
<div id="myTable">
your contents
</div>
__________________

Please login or register to view this content. Registration is FREE
amygdela is offline
Reply With Quote
View Public Profile
 
Old 03-20-2006, 08:08 PM Re: table 100% width & height
jyoz22's Avatar
Ultra Talker

Posts: 278
Location: Orlando, FL
Trades: 0
thanks, i'm goint to try that what i used to do was make a table that was 100% in height with only 1 cell and then in that cell put another table that's 100% in height and body of the site.
jyoz22 is offline
Reply With Quote
View Public Profile
 
Old 03-20-2006, 08:14 PM Re: table 100% width & height
amygdela's Avatar
Super Talker

Posts: 111
Trades: 0
that could be as well, but nesting tables (table in table) is taking more time to load because your browser has to calculate the room the table will take within the other table. I hate tables
__________________

Please login or register to view this content. Registration is FREE
amygdela is offline
Reply With Quote
View Public Profile
 
Old 03-21-2006, 05:09 AM Re: table 100% width & height
Super Talker

Posts: 102
Trades: 0
Quote:
Originally Posted by amygdela
You can make the table 100% in height and width with CSS, but the 100% height of the table must be related to another 100% height, and for that we use the <body> tag.

body, html {
height: 100%;
margin: 0;
padding: 0;
background: #FFF;
}
#myTable {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}

<body>
<div id="myTable">
your contents
</div>
For some browsers just setting body to 100% isn't enough, I'd add the html tag too. While a height of 100% on a DIV is fine, 100% height on a table won't validate. So you might want to use DIV's just as amygdela suggested
ghettobert is offline
Reply With Quote
View Public Profile
 
Old 03-21-2006, 06:50 PM Re: table 100% width & height
amygdela's Avatar
Super Talker

Posts: 111
Trades: 0
you're right, I forgot the html tag in the CSS.
__________________

Please login or register to view this content. Registration is FREE
amygdela is offline
Reply With Quote
View Public Profile
 
Old 03-21-2006, 08:37 PM Re: table 100% width & height
jyoz22's Avatar
Ultra Talker

Posts: 278
Location: Orlando, FL
Trades: 0
thanks you guy's i'm going to start trying to change it do <div>'s , but i've always been a <table> kinda guy...
jyoz22 is offline
Reply With Quote
View Public Profile
 
Old 03-22-2006, 12:30 AM Re: table 100% width & height
Novice Talker

Posts: 11
Trades: 0
Yes you should definitely learn Divs!

Remember that not every browser support CSS and not every browser support your first example. 99% of the world use a decent navigator even those African who uses priceless computers with an incredibly slow internet connection.
Mickoes is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to table 100% width & height
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.35004 seconds with 12 queries