Image not filling a table table (html4 strict)

D

dorayme

Ben C said:
In Firefox 3 I get a 1px gap at the top and bottom of the image (but not
in Opera). Konqueror also has the gap. The image is the right width.

I get in FF2:
<http://dorayme.890m.com/alt/justPics/killy2_except_in_ff.png>

....
As for the other problem (which I don't know if you're seeing, but you
probably are) it's related to border-collapse: collapse.

If you add background: #ddd to the relatively positioned div and
background: pink to the table and then try with and without
border-collapse: collapse, you can see that when Firefox collapses a
border the border box of the table ends up outside the div. Making the
border on the td much bigger makes the problem clearer. Konqueror
(3.5.9) does the same.

Opera does what one might have expected-- the table doesn't overflow the
div it is in even with border-collapse: collapse. But actually I think
Opera is wrong and Firefox 3 and Konqueror are right: see CSS 2.1
17.6.2.

Without border-collapse: collapse they all behave the same-- the table
always leaves room for 2px around any cell borders. This is correct and
is because 2px is the border-spacing from the default stylesheet.

Of course if the outer div's top and bottom edges are in a different
position relative to the cell contents, our absolutely positioned img
container moves and that is the problem.

So the solution is OK provided you don't want collapsed borders.

What I am seeing in Safari 3 (latest Mac) and Opera, I am getting when
I remove border-collapse is image protruding top and bottom of its cell
and fixable by bumping up top:2px; and bottom:2px; to 4px each. I can't
say about FF 3.
Note that there is one other fishy thing we are relying on here which is
auto "left" for the absolutely positioned div around the img. It's
supposed to get positioned where it would have been if it had normal
flow, but browsers are free to guess at it.


Yes that looks fine-- but I never had the width problem in the first
place. Must have been fixed in Firefox 3. It's 3.0 I'm using.


But still the border-collapse problem. If the table has border-collapse:
collapse removed then it looks the same in all three.

Without border-collapse, adjustments of top and bottom from 1px to 4px
are needed at my end in Opera, Safari and FF2 to make them look more or
less kosher and the same.

I forget if I have said that if we carry on like this we should open a
business service to the pixel perfect brigade.... <g>
 
D

dorayme

It seems like the Optus news server is down again. I replied to this
post of yours and it has not appeared (I am now using a backup server).
I have no record of it and would have to reconstruct it... it never
occurs to me to me that something that shows all the signs of being sent
can fail to go. Or maybe it went but did not arrive. Reminder 1 to
myself: set prefs to save posts sent. Reminder 2: throw out the saved
posts once seen to appear.

From what I recall after some discussion of details, I said the problem
was pretty unrealistic and the right cell holding the pic was not really
doing much, it had to be propped open (after border-collapse was
removed, there was nothing left of the poor thing because it had no
content, the content having been taken out of the flow sort of thing and
everything was being done to maintain a certain "look"...)

Just letting you know that I attended to your last post and found it
interesting.

What is wrong with Optus? Why can't they just be perfect?
 

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
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top