Tables tend to collapse to fit their content, unless you tell them
explicitly otherwise with a CSS width or height style declaration.
When you remove that content, the rest of the table shrink-wraps
around what’s left. As you’ve seen, a paragraph of text has a natural
width of 100% of its parent container. When that container loses its
grip on width, a paragraph will shrink to the width of its longest
word, or other non-breakable inline content element.
If you want to hide content but not remove it, you can try toggling
visibility rather than display. But that will just leave a content-
sized hole in your page, rather than what I suspect you want.
If you want a quick pragmatic fix for this layout, just insert a
second image 1px tall by whatever width, after your caption. This will
shim the table and keep if from collapsing. This is, by the way, what
Freeway has been up to since 1997 with those little _clear.gif images
it sprinkles into each and every table.
Walter
On Mar 4, 2011, at 8:54 AM, David Ledger wrote:
I have a table with one Š and one row.
The caption tag is styled ‘text-align: left’ and the caption body
are text and an image.
The row has one cell that contains a table of thumbnail images.
An ‘onclick’ on the image within the caption body sets the row’s
style.display=‘none’. When that happens the caption body text &
image collapse into one column, one word per line.
I can’t see the exact code because the Firefox & Safari inspectors,
and View Source show what is originally downloaded and this is
created by Ajax.
If I don’t use a caption tag but a first row and single cell for the
‘caption’ text & image it leaves the ‘caption’ text intact.
Is this a browser bug?
David
–
David Ledger - Freelance Unix Sysadmin in the UK.
HP-UX specialist of hpUG technical user group (www.hpug.org.uk)
email@hidden
www.ivdcs.co.uk
dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options