Table Width/Height Trouble

liunx

Guest
I'd like to make a table that is 100% of the screen width and height, minus a certain number of pixels.<br />
<br />
For example, if a screen width is 800 then the table would be 800 minus 100, so 700. If the screen width was 1024 then the table would be 1024 minus 100, so 924. I have a basic code that looks like this:<br />
<br />
<TABLE WIDTH="100%" HEIGHT="100%"><br />
<TR><br />
<TD WIDTH="100pc - 200px" HEIGHT="100pc - 200px" BGCOLOR="red"><br />
</TABLE><br />
<br />
But that obviously doesn't work. How can this be accomplished?<br />
<br />
Thank you in advance.<!--content-->Use CSS<br />
<br />
body {<br />
margin: 2px;<br />
}<br />
<br />
This will leave a 2px margin at the bottom, top and left (and right too I think!)<br />
<br />
HTH<!--content-->karinne, I would like about 150 pixels on the left and about 50 pixes on the top. I don't want any space on the bottom or the right. How would I go about doing that?<br />
<br />
Thanks for your reply :)<!--content-->body {<br />
margin-left: 150px;<br />
margin-top: 50px;<br />
margin-bottom: 0;<br />
margin-right: 0;<br />
}<br />
<br />
;)<br />
<br />
edit: ooops.... forgot margin-right!<br />
<br />
edit 2: here's a link for ya! check the css on w3c.org (<!-- m --><a class="postlink" href="http://www.w3.org/TR/CSS2/box.html#propdef-margin">http://www.w3.org/TR/CSS2/box.html#propdef-margin</a><!-- m -->)<!--content-->Cool, thanks karinne!<!--content-->No problem! ;)<!--content-->
 
Back
Top