Problem with table width: mozilla renders it, IE makes up numbers

S

spodosaurus

Hi all,

I'm trying to make a website with a fixed table width centred in the
page. The width is specified using:

<table width="779">

This works fine in the latest version of mozilla, 1.7.13. However, in
IE6 it renders as 955 pixels. (IE also ignores row height specifications
half the time, but that's something I'll work on later) I want this
website to be viewable with both mozilla and IE rather than look goofy
in one but nice in the other.

Can anyone explain to me why this is happenening and what I can do to
make IE render the table at the fixed width I want?

Regards,

Ari


--
spammage trappage: remove the underscores to reply

I'm going to die rather sooner than I'd like. I tried to protect my
neighbours from crime, and became the victim of it. Complications in
hospital following this resulted in a serious illness. I now need a bone
marrow transplant. Many people around the world are waiting for a marrow
transplant, too. Please volunteer to be a marrow donor:
http://www.abmdr.org.au/
http://www.marrow.org/
 
D

dorayme

spodosaurus said:
Hi all,

I'm trying to make a website with a fixed table width centred in the
page. The width is specified using:

<table width="779">

This works fine in the latest version of mozilla, 1.7.13. However, in
IE6 it renders as 955 pixels. (IE also ignores row height specifications
half the time, but that's something I'll work on later) I want this
website to be viewable with both mozilla and IE rather than look goofy
in one but nice in the other.

Can anyone explain to me why this is happenening and what I can do to
make IE render the table at the fixed width I want?

url?

First, put style info for the table in css. If you want to do it
inline, put style="width: 779px" instead of what you have about
width. The "px" bit is important.

Second, there is no normal way a browser will respect your
widths for anything if you have content that can't normally and
sensibly fit in there (like a landscape picture in a too small
portrait box). Or if your widths for the cells in the row do not
make mathematical sense.

And surely other things too. Did I say url?
 
A

Andy Dingley

spodosaurus said:
I'm trying to make a website with a fixed table width centred in the
page.

Don't. Get with the 21st century and do it right. Download yourself a
CSS 3 columen template and use that instead of abusing tables (try
glish or bluerobot)
 
T

Travis Newbury

Andy Dingley said:
Don't. Get with the 21st century and do it right. Download yourself a
CSS 3 columen template and use that instead of abusing tables (try
glish or bluerobot)

This is assuming you have several years to wait for everyone to get a
browser that CSS actually works correclty in....

Otherwise, just use tables because it works....
 
C

Chaddy2222

spodosaurus said:
Hi all,

I'm trying to make a website with a fixed table width centred in the
page. The width is specified using:

<table width="779">

This works fine in the latest version of mozilla, 1.7.13. However, in
IE6 it renders as 955 pixels. (IE also ignores row height specifications
half the time, but that's something I'll work on later) I want this
website to be viewable with both mozilla and IE rather than look goofy
in one but nice in the other.

Can anyone explain to me why this is happenening and what I can do to
make IE render the table at the fixed width I want?
Place the width as a percentage rather then in PX units. Different
browsers use different window sizes, as in the scroll bars in IE, or
users may have a specific font size etc etc.
So if you want to use a table to place the text and images of a page,
then you should center it and then just give it a width of say 25% and
you may not need to concern yourself with the hight, but you should set
that as a % as well.
This will mean your page will still look similar on a range of browsers
but will be able to be changed, made more viewable by the visitor if he
or she desirers.
 
J

Jonathan N. Little

Travis said:
This is assuming you have several years to wait for everyone to get a
browser that CSS actually works correclty in....

Otherwise, just use tables because it works....

Sorry that is BS, OP *is* using a table and *still* having difficulties!
Normally fixing the errors one can get very satisfactory results without
relying on tables for layout in spite of IE.
 
A

Andy Dingley

Travis said:
This is assuming you have several years to wait for everyone to get a
browser that CSS actually works correclty in....

More browsers support CSS usably than work with tables and fixed widths
in pixels

(think mobile devices)
 
B

Beauregard T. Shagnasty

Here's a fairly good one from bluerobot, though it uses pixel
dimensions, Verdana, and fixed font sizes.
http://bluerobot.com/web/layouts/layout3.html

Glish is now a bit long in the tooth.
This is assuming you have several years to wait for everyone to get a
browser that CSS actually works correclty in....

You should upgrade from Netscape 3... :)

This one works well in just about any browser.
http://benmeadowcroft.com/webdev/csstemplates/3-column.html
Otherwise, just use tables because it works....

Tables work fine for (um, have I heard this before?) tabular data.
 
J

Jukka K. Korpela

spodosaurus said:
I'm trying to make a website with a fixed table width

Stop trying that. Problem solved.
The width is specified using:

<table width="779">

That's a spectacularly bad choice. Did you ever check what it looks like in
Print Preview, for example?
This works fine in the latest version of mozilla, 1.7.13. However, in
IE6 it renders as 955 pixels.

So? You're not giving any relevant facts like the URL, so I give just the
general answer: that's how things should be expected to be. Different
browsers work differently. Do you realize what the width attribute _means_?
It is the suggested minimum width. On the other hand, you have probably far
too much stuff*) on the page, if the table requires, on some browser, that
much width.

*) I don't say "content", since much of the stuff is probably not content
proper but noise and distraction.
 
D

dorayme

Jonathan N. Little said:
Sorry that is BS, OP *is* using a table and *still* having difficulties!
Normally fixing the errors one can get very satisfactory results without
relying on tables for layout in spite of IE.

I think Travis meant that there is a smaller learning curve to
getting a table layout to look good and consistent over all
browsers. Surely he is right, eh young Jonathan?

If you set out a table for reasonable aims for websites, along
with the methods of achieving them, along further with the levels
of difficulty, and then, for good measure make a set of the
various possible graphs, remarks like Travis's come from looking
at different graphs to what you are looking at.
 
D

dorayme

"Andy Dingley <[email protected]>"
More browsers support CSS usably than work with tables and fixed widths
in pixels

(think mobile devices)

If this is true, it is because the way you are counting and
restricting the meaning of "usable" and leaving out puzzling
visual behaviours . If you count instances, the overwhelming
number are on winboxes on IE on screens at least 14 inches
diagonally.
 
J

Jonathan N. Little

dorayme said:
I think Travis meant that there is a smaller learning curve to
getting a table layout to look good and consistent over all
browsers. Surely he is right, eh young Jonathan?

Not sure when he states "have several years to wait for everyone to get
a browser that CSS actually works correclty in" CSS works fro the most
part even in IE. What could be simpler then:
<h1>My Heading</h1>
<h2>Subheading</h2>
<p>Stuff about subheading....</p>
<h2>Another subheading</h2>
<p>More stuff about another subheading....</p>

Young? Er said:
If you set out a table for reasonable aims for websites, along
with the methods of achieving them, along further with the levels
of difficulty, and then, for good measure make a set of the
various possible graphs, remarks like Travis's come from looking
at different graphs to what you are looking at.
 
D

dorayme

I think Travis meant that there is a smaller learning curve to
getting a table layout to look good and consistent over all
browsers. Surely he is right, eh young Jonathan?

Not sure when he states "have several years to wait for everyone to get
a browser that CSS actually works correclty in" CSS works fro the most
part even in IE. What could be simpler then:
<h1>My Heading</h1>
<h2>Subheading</h2>
<p>Stuff about subheading....</p>
<h2>Another subheading</h2>
<p>More stuff about another subheading....</p>[/QUOTE]

He meant that most folk are not using very compliant browsers and
the test is things that are not captured by these "school
exercise" examples. You have probably lost sight of just how
tricky it is for folk in real layout situations.
 
T

Toby Inkster

Jonathan said:
CSS works fro the most part even in IE. What could be simpler then:
<h1>My Heading</h1>
<h2>Subheading</h2>
<p>Stuff about subheading....</p>
<h2>Another subheading</h2>
<p>More stuff about another subheading....</p>

Ummm... that's not CSS though.
 
J

Jonathan N. Little

Toby said:
Ummm... that's not CSS though.

No it is not, but my point was basic markup works and is easier than a
table since many webpages with table layout still just do the "totem
pole" layout of a page.

[.....text.....]
[image]
[.....text.....]
[image]
[.....text.....]
[image]
[.....text.....]
[image]
[.....text.....]
[image]


Usually all on one page for a real scroll-wheel workout...
 
A

Andy Dingley

dorayme said:
If this is true, it is because the way you are counting and
restricting the meaning of "usable" and leaving out puzzling
visual behaviours .

By "usable" I'm assuming competent CSS coding giving a usable display
(subject to some rendering variation)

I accept that this isn't the case for typical sites in existence today,
but it's achievable with the right skills - and that's my point.
If you count instances, the overwhelming
number are on winboxes on IE on screens at least 14 inches
diagonally.

Those are an easy target for usable CSS. They're even a practical
target for _accurate_ CSS rendering, for any halfway-competent
professional web developer. IE 4 is a rarity these days - you can't
seriously claim that it's a commercial problem to maintain
pixel-accuracy back that far.
 
D

dorayme

"Andy Dingley <[email protected]>"
By "usable" I'm assuming competent CSS coding giving a usable display
(subject to some rendering variation)
Yes, and by "competent CSS coding" you are building in all
knowledge of how to make things work well in IE. This is rather
different to the knowledge needed to make things work in better
browsers. The same competency that is required to render a table
in Firefox serves for IE. IE-Bug-Science deserves its own faculty.
I accept that this isn't the case for typical sites in existence today,
but it's achievable with the right skills - and that's my point.


Those are an easy target for usable CSS. They're even a practical
target for _accurate_ CSS rendering, for any halfway-competent
professional web developer. IE 4 is a rarity these days - you can't
seriously claim that it's a commercial problem to maintain
pixel-accuracy back that far.

Never mind IE 4, or pixel accuracy... lets talk non-crazy
variations across browsers: on this standard, you should be able
to see why folk make remarks like Travis's
 
A

Andy Dingley

Yes, and by "competent CSS coding" you are building in all
knowledge of how to make things work well in IE.

No, I'm talking about how to write to the standard, not the sort of
forensic pathology you need to understand all of IE's foibles.
Even at its worst, a competent valid site viewed through IE is no worse
than trying to view pixel-sized rigid tables from a re-sized window.
 
D

dorayme

Andy Dingley said:
Even at its worst, a competent valid site viewed through IE is no worse
than trying to view pixel-sized rigid tables from a re-sized window.

Well, this is interesting. let me assume you have not built too
much into "competent". Is it true though? We need a set of
cases... Viewing things that do crazy things in IE from standard
CSS instructions makes people anxious, that they cannot see all
of a table without scrolling is just an understandable bother...
the one causes folk to reach for the valium, to bang their head a
bit.. the other ... well, just another irritation like
non-human-answering telephone systems.

(God, this is time consuming... I know what I am doing...
avoiding trying to figure out a way to get text and pics from a
..pub document given to me so that I can throw it into some sort
of html shape. I am on a Mac and have not got Publisher and may
have to get it etc...and put it on my old PC and so on...
yawn...why don't clients send just text and pics?)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top