473,441 Members | 1,460 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,441 software developers and data experts.

Table caption shifted for 1px in Firefox

VK
On the demo at
<http://www.geocities.com/schools_ring/tmp/demo01/index.xml> the table
caption has 1px(?) indentation from the left in Firefox 1.5 and I'm
running out of ideas how to kill it - if it's possible at all. (Opera 9
shows a bigger indentation (2px?) but from the right side, but this fun
is for later :-)
IE displays the expected (at least by me) layout.

The relevant HTML block in the transformer
<http://www.geocities.com/schools_ring/tmp/demo01/default.xsl> is

....
<table
<col width="20%" /><col width="50%"
/><col width="15%"
/><col width="15%"

/><caption>Repository</caption
<thead
<tr
<th>Name</th
<th>Description</th
<th>Demo</th
<th>Download</th
</tr

....

The relevant CSS block in the sheet
<http://www.geocities.com/schools_ring/tmp/demo01/default.css> is
....
table {
width: 100%;
margin: 0px auto;
padding: 0;
border-style: none;
border-collapse: collapse;
-moz-binding: url(zebra.xml#default);
behavior: url(zebra.htc)}

table caption {
width: 100%;
margin: 0px auto;
border: 1px solid #000000;
background-color: #DDDDDD;
padding: 5px 0px;
font-weight: bold}
....

If needed I can make a minimum case on a conventional HTML page, I just
thought someone may know an immediate know-how / no way answer.

May 16 '06 #1
5 3941
VK wrote:
On the demo at
<http://www.geocities.com/schools_ring/tmp/demo01/index.xml> the table
caption has 1px(?) indentation from the left in Firefox 1.5 and I'm
running out of ideas how to kill it - if it's possible at all. (Opera 9
shows a bigger indentation (2px?) but from the right side, but this fun
is for later :-)
IE displays the expected (at least by me) layout.


I was only reading about this yesterday:

http://www.aurora-il.org/table_test.htm

ex1 runs through the problem and ex2 solves. You just apply

caption {margin:-1px;}

apparently IE doesn't recognise margin values applied to <caption> so it
will just ignore it.

As to what you can do with opera; if the current version is the same as
Opera 7.54 then the above fix means that the caption won't render at all.

I suggest clicking your heels together three times with your fingers
crossed and hoping the problem goes away.

--
Brian O'Connor (ironcorona)
May 16 '06 #2
VK

VK wrote:
On the demo at
<http://www.geocities.com/schools_ring/tmp/demo01/index.xml> the table
caption has 1px(?) indentation from the left in Firefox 1.5 and I'm
running out of ideas how to kill it - if it's possible at all. (Opera 9
shows a bigger indentation (2px?) but from the right side, but this fun
is for later :-)
IE displays the expected (at least by me) layout.

ironcorona wrote: I was only reading about this yesterday:
http://www.aurora-il.org/table_test.htm

ex1 runs through the problem and ex2 solves. You just apply

caption {margin:-1px;}

apparently IE doesn't recognise margin values applied to <caption> so it
will just ignore it.

As to what you can do with opera; if the current version is the same as
Opera 7.54 then the above fix means that the caption won't render at all.

I suggest clicking your heels together three times with your fingers
crossed and hoping the problem goes away.


Thanks, I updated the demo at
<http://www.geocities.com/schools_ring/tmp/demo01/index.xml>

Eh... With margin: auto -1px in Firefox left indent goes away, but an
approx 2px indent appears from the right (just like Opera 9 Beta did
before).
Opera 9 Beta now shows the caption right.
IE keeps showing the caption right, but table body seems not the same
(by columns' width) and all behaviors seems be lost (unlike in
Firefox).

I guess it's one of these dark styling glitches you better not touch -
as there is a hell hidden behind them :-)

I will read the article you've linked for a possible enlightment. If
failed within an hour I just leave it as it was (1px indent is
definitely irritating but something I can live with).

P.S. Truthfully the physical sense of negative margins in static
elements is beyond the scope of my understanding. :-(

May 16 '06 #3
VK

VK wrote:
On the demo at
<http://www.geocities.com/schools_ring/tmp/demo01/index.xml> the table
caption has 1px(?) indentation from the left in Firefox 1.5 and I'm
running out of ideas how to kill it - if it's possible at all. (Opera 9
shows a bigger indentation (2px?) but from the right side, but this fun
is for later :-)
IE displays the expected (at least by me) layout.
ironcorona wrote:
I was only reading about this yesterday:
http://www.aurora-il.org/table_test.htm

ex1 runs through the problem and ex2 solves. You just apply

caption {margin:-1px;}

apparently IE doesn't recognise margin values applied to <caption> so it
will just ignore it.


OK, thanks again for the tip, negative margin did the trick for FF
half-way: it's still here, but I managed to shift it to the right side
(a la Opera 9) which is visually much less irritating. The used hack
is:
....
table caption {
margin: 0px 0px 0px -1px;
....

Yet this hack is a complete woodoo to me (both in the reason of the
indent and in the way to move it away).

<http://www.aurora-il.org/table_test.htm> explains it as
<q>Since the caption lies within the table itself and we've not
assigned a specific width to it, its width is equal to the total width
of the table. Since a 1px border has been specified for the table, and
the total table width includes half the border, the computed caption
width ends up being 1 pixel less (1/2 from the left and right borders
respectively), resulting in the 1 pixel difference. Since a 1/2 pixel
cannot be rendered on-screen, Firefox adds the two half pixels together
and stick the resulting pixel space on the left border.</q>

AFAIK (and confirmed by MDC) table caption does *not* lie within the
table, and this is I guess the reason of discrepancies with IE. The
table caption is a whole separate (from the table) elements sharing
with the table the same anonymous box. I have no idea how and why would
it affect on parasite indents in my caption but obviously it does.
Please note that table borders are set to
border-width: 0px;
border-style: none;

Moving forward, any way...

May 16 '06 #4
In article <11**********************@j55g2000cwa.googlegroups .com>,
VK <sc**********@yahoo.com> wrote:

VK wrote:
> > On the demo at
> > <http://www.geocities.com/schools_ring/tmp/demo01/index.xml> the table
> > caption has 1px(?) indentation from the left in Firefox 1.5 and I'm
> > running out of ideas how to kill it - if it's possible at all. (Opera 9
> > shows a bigger indentation (2px?) but from the right side, but this fun
> > is for later :-)
> > IE displays the expected (at least by me) layout.

ironcorona wrote:
> I was only reading about this yesterday:
> http://www.aurora-il.org/table_test.htm
>
> ex1 runs through the problem and ex2 solves. You just apply
>
> caption {margin:-1px;}
>
> apparently IE doesn't recognise margin values applied to <caption> so it
> will just ignore it.


OK, thanks again for the tip, negative margin did the trick for FF
half-way: it's still here, but I managed to shift it to the right side
(a la Opera 9) which is visually much less irritating. The used hack
is:
...
table caption {
margin: 0px 0px 0px -1px;
...

Yet this hack is a complete woodoo to me (both in the reason of the
indent and in the way to move it away).


You are right about this anyway. Needs more investigation.

An added |-moz-box-sizing: content-box;| helps as well - but I suspect
that this is just chasing shadows.

[later...] See also https://bugzilla.mozilla.org/show_bug.cgi?id=333643
--
John P Baker
May 17 '06 #5
VK

JP. Baker wrote:
An added |-moz-box-sizing: content-box;| helps as well - but I suspect
that this is just chasing shadows.
Hah! <http://www.quirksmode.org/css/box.html>
-moz-box-sizing: content-box;

Doesn't solve my current problem, but the coolest discover of the year
for me.
[later...] See also https://bugzilla.mozilla.org/show_bug.cgi?id=333643


Yup. With two perfect testcases (plus mine 3rd) still not promoted even
to CONFIRMED. I guess some rendering evangelism problem.

I guess I just drop background and borders for caption (plain text
only). I had too much of productivity problems with <td span> element
starting the table to use this option.

May 17 '06 #6

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

Similar topics

0
by: Sharon | last post by:
Hiya, I have this stylesheet (based on an example @ http://rdcpro.com/xmldev/filterandsort)which I'm trying to modify so that it will work for my own XML and I get some data but it doesn't appear...
2
by: Edward | last post by:
The below code builds 2 tables 4 rows by 4 cols. All cells have checkboxes. When checked, the checkboxes in the first column automatically check the remainder of the check boxes in the same row. ...
4
by: eomer | last post by:
I would like my table header to have a border on the bottom. What I have written works in Mozilla (1.7.12) but not IE (6). I have included the snippet of html and the snippets of CSS. Any...
7
by: Johnny | last post by:
In MSIE table captions are displayed at the same size as content. But in Firefox the text displays at browser default, It also exceeds the width of the table and the excess is hidden if the table...
4
by: Daz | last post by:
Hello everyone. I have a simple problem which can be solved quite simply, I am just going about it the wrong way. I would like to wipe every row from within a named table, but I am not too sure how...
9
by: Neal | last post by:
http://www.brassattackofspringfield.com/gigs.html CSS at http://www.brassattackofspringfield.com/default.css Opera and IE render caption as desired. Firefox does not. Why? And is there a fix?
6
by: dontwantspam | last post by:
Hello everyone, I'm working on this css site redesign http://www.maranathamalta.com/4given/testingmain.php I've tested on my machine running XP using Firefox 2.0.0.4, IE6 and IE7. It looks...
0
by: Pete Horrobin | last post by:
I'm having a problem getting a table caption to appear as desired in Firefox, and am wondering if anyone here might have an answer. Test page: http://www.horshamhc.co.uk/site07/captiontest.htm ...
3
by: bigteejay | last post by:
I'm using a web application for an online survey system. The pages rendered are XHTML transitional ("<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.