Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Screen filling Tables 5

Status
Not open for further replies.

zefir

Technical User
Sep 21, 2000
344
EU
Is it possible to create a table, which fills the
visible area of the actual screen window completely,
without any additional background ?
Based on standard HTML 4.0 .
G.Hoffmann
 
Try use the margin options in you BODY tag like this:

<BODY leftMargin=&quot;0&quot; topMargin=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot;>

Qwark
 
I agree, you must set your margins to zero.

Also, be sure you set your table padding and spacing to zero:
[tt]
<table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;>[/tt]
Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
 
Qwark: Thank you very much.
I had sent my thanks immediately,
but the message seems to be lost.
Thanks Tom. ----G.Hoffmann
 
For tables with fixed pixel width and pixel height
leftmargin and topmargin aligns to the top left corner.
Of course the bottom right corner cannot be aligned.
This is absolutely correct. ---G.Hoffmann
 
Is that a question? If so, then I guess the answer is that you can align whatever you want wherever you want by nesting tables. If you set your margins to zero, and create a borderless table with width=100% and height=100%, set your align=right and valign=bottom, you can align your fixed dimension inner table to the bottom-right of your screen.
Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
 
Tanderso: it has been a statement !
I want to say: IF the table is defined in pixels
and NOT in percentage, THEN it is reasonable,
that bottom right canNOT be aligned.
Then the interesting case is this:
The LAST column and the LAST row is not
defined in pixels but by &quot;Fill to FullScreen&quot;.
Is this possible ?
G.Hoffmann
 
<table id=&quot;unf&quot; style=&quot;position:absolute;left=0;top:0;&quot; bgcolor=&quot;#336699&quot;><tr><td>dsgsfgf</td></tr></table>
<script>
unf.style.width = document.body.offsetWidth - 20;
unf.style.height = document.body.offsetHeight - 4;
</script>

this works in ie for me...


adam@aauser.com
 
Thanks, lucid:
But can this be done without STYLES ?
I like very much a &quot;reduced instruction set&quot; of HTML 4.0
and anything else is transfered by PDF !
G.Hoffmann
 
well, the only way i know to change the width of the element in ie is to use id.style.width.

but, you dont need the position:absolute, or the left:0;, or any of the styles in the element.

adam@aauser.com
 
zefir,

Or maybe you can use javascript to define the width of the table,

<script>
var aw = screen.availWidth;
var ah = screen.availHeight;
document.write(&quot;<table width=&quot;+aw+&quot; border=0 cellspacing=0 cellpadding=0>&quot;)
document.write(&quot;<tr>&quot;)
document.write(<td>....</td>&quot;)
document.write(<td>....</td>&quot;)
.....
.....
document.write(&quot;</tr>&quot;)
document.write(&quot;<table>&quot;)
</script>

Chiu Chan
cchan@gefmus.com
 
You can align your fixed-pixel width table to the bottom right if you nest it in another table, like this:

<body>
<table border=&quot;0&quot; width=&quot;100%&quot; height=&quot;100%&quot;>
<tr>
<td width=&quot;100%&quot; height=&quot;100%&quot;
align=&quot;right&quot; valign=&quot;bottom&quot;>

<table border=&quot;1&quot; width=&quot;35&quot; height=&quot;35&quot;>
<tr>
<td>Your content inside your fixed-width table</td>
</tr>
</table>


</td>
</tr>
</table>

</body>

If you want a dynamic way to do this after the fact, then you'll have to use a scripting language like Adam suggested.
Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
 
but what if the browser window is smaller than the screen's available width and height? adam@aauser.com
 
I created a group of nested tables for an interactive portion of my company's website that uses a combination of both widths &amp; heights defined in percentages as well as pixels. It covers the entire screen and works in both netscape &amp; ie. A sample page is located at:


check it out.

Cullen Cox
cullenc3@aol.com
Graphic Artist/Web Designer
 
Thanks to everybody.
My basic intention is always to use a reduced instruction
set of HTML 4.0, mainly to stabilize the appearance for all
kind of browsers.
This is a part of a lecture &quot;Internet Programming for beginners&quot;.
All graphically well designed documents are then transfered as PDFs.
A simple approach for the problem &quot;How to make a table,which is
defined in pixels, not only aligned Top Left but also Bottom Right&quot;
may be this:
Make the right column and the bottom row - combined with
the whole table - larger than the expected area.
The disadvantage is then: scrollbars appear.
G.Hoffmann
 
zefir, is there something you did not understand about my post? Your answer to how to align a fixed-pixel table to the bottom-right is clearly laid out.
Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
 
Tom: I had printed all messages, in order to use
all the recommendations later.
Your method is certainly OK. I didn´t notice
the nested construction, I thought you were
working with percentage only. ----G.Hoffmann
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top