Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 20th, 2005, 06:47 PM
Timothy Madden
Guest
 
Posts: n/a
Default How to make a table render to the width of the window ?


Hello

Please take a look at this table:
http://web.ss.pub.ro/~bat/HelloWorld.php

Now the table has the width property set to 100%, which should mean the
width available to the browser. Does this mean the width of the browser's
window ? On 800x600 IE6.0 the window has a horzontal scroll bar, wich I
don't want to be there. You know, sometimes, with other tables, it works...

How can I make the table so that:
- the whole table width is the browser's window width
- the first colomn of the table has it's intrinsic width (minimum width
required, 0*)
- and the second table has the remaining width, no less than a given
minimum width ?

I tried setting the table width to 100% with CSS (the width of the body
element); it didn't work

--
Thank you
Timothy Madden
---------------------------
And I don't wanna miss a thing
  #2  
Old July 20th, 2005, 06:47 PM
Els
Guest
 
Posts: n/a
Default Re: How to make a table render to the width of the window ?


Timothy Madden wrote:
[color=blue]
> Hello
>
> Please take a look at this table:
> http://web.ss.pub.ro/~bat/HelloWorld.php
>
> Now the table has the width property set to 100%, which should mean the
> width available to the browser. Does this mean the width of the browser's
> window ? On 800x600 IE6.0 the window has a horzontal scroll bar,[/color]

Not only on 800x600, it has a scrollbar at 1280x1024 as well...
[color=blue]
> wich I
> don't want to be there. You know, sometimes, with other tables, it works...
>
> How can I make the table so that:
> - the whole table width is the browser's window width[/color]

By setting the width at 100%, or rather 99%, to avoid the
horizontal scrollbar in some browsers because of margins of
body and stuff.
[color=blue]
> - the first colomn of the table has it's intrinsic width (minimum width
> required, 0*)[/color]

you did that already, it seems?
[color=blue]
> - and the second table has the remaining width, no less than a given
> minimum width ?[/color]

you mean second column?
[color=blue]
> I tried setting the table width to 100% with CSS (the width of the body
> element); it didn't work[/color]

That may be because the line
/usr/local/etc/Suids:/usr/local/bin:/usr/bin:/usr/sbin:/usr/dt/bin:/usr/openwin/bin:/usr/proc/bin:/usr/ccs/bin:/usr/openwin/bin/demo:/var/qmail/bin:/usr/local/java2sdk/bin:/usr/local/teTeX/bin/sparc-sun-solaris2.5.1:/usr/local/pgsql/bin:/usr/local/oracle/Soft/805/bin:/opt/bin:/usr/local/oracle/bin:.:/usr/local/sbin
just can't wrap.
Well, it dus wrap in IE, but only because of the hyphen in
sparc-sun-solaris2.5.1 ;-)


--
Els

Mente humana é como pára-quedas; funciona melhor aberta.

  #3  
Old July 20th, 2005, 06:47 PM
Jukka K. Korpela
Guest
 
Posts: n/a
Default Re: How to make a table render to the width of the window ?

Els <els.aNOSPAM@tiscali.nl> wrote:
[color=blue][color=green]
>> I tried setting the table width to 100% with CSS (the width of the
>> body element); it didn't work[/color]
>
> That may be because the line
> /usr/local/etc/Suids:/usr/ - -
> /bin:/usr/local/oracle/bin:.:/usr/local/sbin just can't wrap.[/color]

Quite right. The browser either expands the table to fit, or lets the
content overflow, or truncates it. This depends on many things,
including the setting of the table-layout property (in CSS).

Or it _could_ wrap, but browsers are not required to wrap it. Actually
the OP's page, or service, seems to have goals similar to the simple
"echo HTTP headers" script that I wrote recently, and I encountered
similar problems. The background (namely browsers not wrapping strings
with no whitespace and ways to deal with it) are explained at
http://www.cs.tut.fi/~jkorpela/html/nobr.html#suggest

What I do in practice (see the effect at
http://www.cs.tut.fi/cgi-bin/run/~jkorpela/headers.cgi )
is to insert <wbr> after each comma and after each slash in the cell
that shows an HTTP header value. Those headers seem to use spaces
rather sparingly, so something needs to be done. I haven't figured out
a simple way to defeat IE's eagerness to break a line after a hyphen
here, so I will just tolerate things like application/vns.ms-
excel

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

  #4  
Old July 20th, 2005, 06:47 PM
Stan Brown
Guest
 
Posts: n/a
Default Re: How to make a table render to the width of the window ?

It seems "Timothy Madden" wrote in
comp.infosystems.www.authoring.html:[color=blue]
>Now the table has the width property set to 100%, which should mean the
>width available to the browser. Does this mean the width of the browser's
>window ?[/color]

Yes, however the width="100%" is a _suggestion_ that gets overridden
by content.

Because your "path" entry is very very very long and contains no
spaces, the table is about four times the width of my window.

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
  #5  
Old July 20th, 2005, 06:47 PM
Timothy Madden
Guest
 
Posts: n/a
Default Re: How to make a table render to the width of the window ?


Ok, Thank you.
I got it now.
Too bad HTML doesn't have more options about text wrapping

--
Timothy Madden
-------------------------
And I don't wanna miss a thing
  #6  
Old July 20th, 2005, 06:47 PM
DU
Guest
 
Posts: n/a
Default Re: How to make a table render to the width of the window ?

Stan Brown wrote:
[color=blue]
> It seems "Timothy Madden" wrote in
> comp.infosystems.www.authoring.html:
>[color=green]
>>Now the table has the width property set to 100%, which should mean the
>>width available to the browser. Does this mean the width of the browser's
>>window ?[/color]
>
>
> Yes, however the width="100%" is a _suggestion_ that gets overridden
> by content.
>
> Because your "path" entry is very very very long and contains no
> spaces, the table is about four times the width of my window.
>[/color]


There are other issues too.

1- <table width="100%" ...> is 100% of the available width as given by
its immediate containing parent in the containment hierarchy: in this
case, the <body>. Now, the default css declaration for the body element
in MSIE 6 for windows (in both rendering modes) is with a
margin: 15px 10px
which is NOT overriden by the file
http://web.ss.pub.ro/~bat/HelloWorld.css
The whole table could not be as wide as the browser's window width
anyway, regardless of the content issue

2- MSIE 6 for windows has a major bug on overflow:visible

3- The default css declaration for the root element in MSIE 6 is
border { medium #000000 inset } // not 0px none;
overflow { visible scroll } // not overflow: auto;

DU

  #7  
Old July 20th, 2005, 06:48 PM
Jukka K. Korpela
Guest
 
Posts: n/a
Default Re: How to make a table render to the width of the window ?

Timothy Madden <batman@rmv.spam.home.ro> wrote:
[color=blue]
> Too bad HTML doesn't have more options about text wrapping[/color]

Actually HTML has lots of options for text wrapping. You just need two
things: to understand the Unicode line breaking rules and control
characters for it, which might take just a few years, and to wait for
browser vendors understand and implement them, which probably takes
considerably longer. :-)

Seriously, you're right. Things like <nobr> and <wbr> should have been
standardized long ago.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

 

Bookmarks

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles