Inheriting what?

F

Frogleg

I devised the following:

<div style="width: 80%;">

<table width="100%">
(table 1)
</table>

<table width="100%">
(table 2)
</table>

</div>

Table 1 occupies the entire width of the <div> quite nicely, but...
with IE, Table 2 occupies only about 80%(!) of the width, while with
Mozilla, it's fine. If I change table 2's width to 120%, not
surprisingly, it displays nicely in IE, but runs over the edge with
Mozilla.

I know the overwhelming answer will be "don't use tables," so let's
just say that my religion requires it.

What is happening here?
 
M

mbstevens

Frogleg said:
I devised the following:

<div style="width: 80%;">

<table width="100%">
(table 1)
</table>

<table width="100%">
(table 2)
</table>

</div>

Table 1 occupies the entire width of the <div> quite nicely, but...
with IE, Table 2 occupies only about 80%(!) of the width, while with
Mozilla, it's fine. If I change table 2's width to 120%, not
surprisingly, it displays nicely in IE, but runs over the edge with
Mozilla.

I know the overwhelming answer will be "don't use tables," so let's
just say that my religion requires it.

A) Become agnostic, :)
or
B) Do some reading here:
http://www.tantek.com/CSS/Examples/boxmodelhack.html
....and here:
http://www.thenoodleincident.com/tutorials/box_lesson/index.html
....and at the links off the opening page there.
 
D

Dominik Jain

Frogleg said:
I devised the following:

<div style="width: 80%;">

<table width="100%">
(table 1)
</table>

<table width="100%">
(table 2)
</table>

</div>

Table 1 occupies the entire width of the <div> quite nicely, but...
with IE, Table 2 occupies only about 80%(!) of the width

I cannot confirm this.
Using the code below, both tables have the full width:

<div style="width: 80%; border: 1px solid green;">

<table width="100%" border="1">
<tr><td>foo</td></tr>
</table>

<table width="100%" border="1">
<tr><td>bar</td></tr>
</table>

</div>

There might be something wrong with the way your tables are formatted
(perhaps you specified column widths that are in conflict with the 100%?).

bye,
 
F

Frogleg

I cannot confirm this.
Using the code below, both tables have the full width:

<div style="width: 80%; border: 1px solid green;">

<table width="100%" border="1">
<tr><td>foo</td></tr>
</table>

<table width="100%" border="1">
<tr><td>bar</td></tr>
</table>

</div>

There might be something wrong with the way your tables are formatted
(perhaps you specified column widths that are in conflict with the 100%?).

It may be, but I can't find it. See
http://home.earthlink.net/~absolutelyfake/test.htm

(Looks fine in Mozilla; doesn't work in IE)
 
D

Dominik Jain

Frogleg said:
Well, it sure doesn't to me. The 2nd table in IE is about 20% narrower
than in Mozilla. Driving me nuts!

What IE version are you using? (I'm using 6 SP1)
Perhaps I'll make some screenshots later today, but I don't have time right
now.
 
F

Frogleg

What IE version are you using? (I'm using 6 SP1)
Perhaps I'll make some screenshots later today, but I don't have time right
now.

I don't need screenshots. I believe you. However, it *does* look
different to me. It's also slightly off using Opera.

When I feed it to Homesite 4.5.1 (which uses IE for the browser view),
it's off about 20%; in Nvu, it's slightly off; in 1st Page 2000, it's
more like 30% off.

I'm have IE 6.0, sp2.
 
C

Chris Beall

Frogleg said:
It may be, but I can't find it. See
http://home.earthlink.net/~absolutelyfake/test.htm

(Looks fine in Mozilla; doesn't work in IE)
Frogleg,

I have reproduced your problem and have tested a solution:

Step 1. Replace the obsolete Transitional DOCTYPE with <!DOCTYPE HTML
PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"> (on one line).

This will fix the symptom you reported.

Step 2. Submit the page to the validator at http://validator.w3.org/.

Step 3. Correct the 6 errors it identifies, all of which relate to the
fact that you are putting style information directly on the HTML, rather
than using CSS.

Cheers,
Chris Beall
 
F

Frogleg

Frogleg wrote:
I have reproduced your problem and have tested a solution:

Step 1. Replace the obsolete Transitional DOCTYPE with <!DOCTYPE HTML
PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"> (on one line).

This will fix the symptom you reported.

Step 2. Submit the page to the validator at http://validator.w3.org/.

Step 3. Correct the 6 errors it identifies, all of which relate to the
fact that you are putting style information directly on the HTML, rather
than using CSS.

Better, but not 'fixed'. To me, in IE6, it looks like this:
http://home.earthlink.net/~absolutelyfake/screenshot.jpg

I *did* send it through validation, and got an error for using
'bordercolor' on one(!) table, which I only use for debugging
purposes; one for 'border' on an image; and one for using 'bgcolor' in
a cell. These all have to do with 'deprecated' attributes.

Thanks for trying. I'm sure I'll get around this, but it's maddening
not to know *why* it's happening.
 
F

Frogleg

AH HAH! I found it! I run at 800x600 rez (and dialup and read by
candelight), and the top 2 images total *more* than 80% of 800!! So
the 2nd table *was* the correct size, and the 1st had been stretched
to accomodate images.

Yes, I *do* check layout at higher resolution, but not until I've
worked things out in my 'usual' environment. Thanks for help. (Nvu may
be pretty handy for other things, too.)
 

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

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top