473,796 Members | 2,702 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
Jul 20 '05 #1
6 3139
Els

Timothy Madden wrote:
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,
Not only on 800x600, it has a scrollbar at 1280x1024 as well...
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
By setting the width at 100%, or rather 99%, to avoid the
horizontal scrollbar in some browsers because of margins of
body and stuff.
- the first colomn of the table has it's intrinsic width (minimum width
required, 0*)
you did that already, it seems?
- and the second table has the remaining width, no less than a given
minimum width ?
you mean second column?
I tried setting the table width to 100% with CSS (the width of the body
element); it didn't work


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.

Jul 20 '05 #2
Els <el*********@ti scali.nl> wrote:
I tried setting the table width to 100% with CSS (the width of the
body element); it didn't work


That may be because the line
/usr/local/etc/Suids:/usr/ - -
/bin:/usr/local/oracle/bin:.:/usr/local/sbin just can't wrap.


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

Jul 20 '05 #3
It seems "Timothy Madden" wrote in
comp.infosystem s.www.authoring.html:
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 ?


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/
Jul 20 '05 #4

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
Jul 20 '05 #5
DU
Stan Brown wrote:
It seems "Timothy Madden" wrote in
comp.infosystem s.www.authoring.html:
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 ?

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.

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:visibl e

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

Jul 20 '05 #6
Timothy Madden <ba****@rmv.spa m.home.ro> wrote:
Too bad HTML doesn't have more options about text wrapping


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

Jul 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

82
10725
by: Peter Diedrich | last post by:
The site design is pretty simple: ============================================ | Head | ============================================ | | | | | | | | | left | center | right | | | | | | | | |
1
4333
by: ajay | last post by:
I have following code for a slide menu but i twiked it to work for a single level menu. Open it in a Browser to get a clear picture. I have 2 Qs 1) How to make first entry as non-link. i.e i want to make first text as Table Heading/menu category. For examle in the given menu i want to make a heading as "Comp. Languages" which won't be a link. 2) The position of this menu is absolute to the page. I want to make it absolute to the Table...
28
5563
by: Anthony Williams | last post by:
Good morning, I'm currently designing a site, using CSS, and wish to create a variable width two-column layout, with header and footer, and one fixed-width column on the left. Previously, I would have used a table to do this, using the following code: <table width="100%">
4
26210
by: N. Demos | last post by:
The following code renders as intended in IE (A TABLE, with cells of fixed width and height, inside of a DIV with fixed width and height and overflow set to hidden.) In Firefox, the table cells assume a narrower with than specified. If I comment out the width for the DIV, then the cells render with the correct width and height. Why is this happening? Thanks. Regards, N. Demos
3
2831
by: RBalbat | last post by:
Hello all, I have encountered an unexpected problem where if I render a table (in IE or Opera) and there are cells that contains URLs with long query strings, even though I specify the table element with the width attribute set as 90%, when I render the document, it spans way off the right side of the screen. For some reason, having a long query string in the cell does some funcky stuff. Does anyone know how to *force* the table to only...
11
3581
by: Norman L. DeForest | last post by:
Am I misunderstanding the CSS specifications or is Firefox (version 1.0.6) (and Opera) doing the wrong thing? It appears that Firefox 1.0.6 includes the border in width calculations for tables but not in height calculations. Oh, and Opera version 8.02 does the same thing. |<-->| |<-->| <------ border |<------------>| <------ table contents
5
2000
by: Novice Computer User | last post by:
Hi. Can somebody PLEASE help. Here is a .php script. Right now, the minimum amount of time (i.e. duration) allowed is 1 month. However, I want to be able to reduce the minimum amount of time to 2 days (i.e. 48 hours). Can somebody PLEASE PLEASE tell me what I need to change in this file to do this? Here is a copy - thanks enormously in advance: <html> <head>
1
16979
by: since | last post by:
I figured I would post my solution to the following. Resizable column tables. Search and replace values in a table. (IE only) Scrollable tables. Sortable tables. It is based on a lot examples I found on the web. Works in IE and mozilla. http://www.imaputz.com/cssStuff/bigFourVersion.html
2
5569
by: AliR \(VC++ MVP\) | last post by:
I'm trying to write a RTF render code in C#. I have the code in C++/MFC and it works fine, but I have run into a problem with the C# code. I think the C# code is from Microsoft, and I added scaling to it. The C# code is working fine on my desktop PC but it cuts off some of the text when I run it on my laptop. The MFC code works fine both on the laptop and the PC. I have looked at all the numbers used in the MFC and the C# code and they...
0
9524
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10449
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10168
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9047
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7546
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6785
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5440
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.