471,071 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Collapsing <p> spacing in a table in Firebird

Hi.

I'm displaying some stats in a table and I'd been putting the text into
a <p> tag inside the <td>s:

<td>
<p>Note 1: See column x for foo...</p>
<p>Note 2: See page <a ...>17</a> for bar</p>
</td>

When the page is viewed in Internet Explorer, the space between the
paragraphs is maintained, but the space above and below the paragraphs
is dispensed with:

+-------------------------------------------+
| Note 1: See column x for foo... |
| |
| Note 2: See page <a ...>17</a> for bar... |
+-------------------------------------------+

Mozilla (Firebird 0.7), on the other hand, renders all the space:

+-------------------------------------------+
| |
| Note 1: See column x for foo... |
| |
| Note 2: See page <a ...>17</a> for bar... |
| |
+-------------------------------------------+

Presumably this is correct behaviour according to the specs, but what
CSS would I have to add to get Mozilla to render more like IE? I'm
curently manually putting "margin-top: 0px;" on the first and
"margin-bottom: 0px;" on the second!

Any help would be greatly appreciated.

- Iain.
Jul 20 '05 #1
10 2378
Iain Hallam wrote:

I'm displaying some stats in a table and I'd been putting the text into
a <p> tag inside the <td>s:

<td>
<p>Note 1: See column x for foo...</p>
<p>Note 2: See page <a ...>17</a> for bar</p>
</td>

Mozilla (Firebird 0.7), on the other hand, renders all the space

what CSS would I have to add to get Mozilla to render more like IE?


td p {margin-bottom:0;}
td p:first-child {margin-top:0; margin-bottom: 1em}

adjust to taste. NB: MSIE/Win cannot parse first-child.

--
Brian (follow directions in my address to email me)
http://www.tsmchughs.com/

Jul 20 '05 #2
Brian wrote:
Iain Hallam wrote:

I'm displaying some stats in a table and I'd been putting the text
into a <p> tag inside the <td>s:

<td>
<p>Note 1: See column x for foo...</p>
<p>Note 2: See page <a ...>17</a> for bar</p>
</td>
td p {margin-bottom:0;}
td p:first-child {margin-top:0; margin-bottom: 1em}

adjust to taste. NB: MSIE/Win cannot parse first-child.


Thanks. Is there a :last-child if I need to include 3 or more paras?

+---------------------------------------------+
| Note 1: See column x for foo... |
| |
| Note 2: See page <a ...>17</a> for bar... |
| |
| Note 3: See site <a ...>x</a> for foobar... |
+---------------------------------------------+

- Iain.
Jul 20 '05 #3
Iain Hallam wrote:
Thanks. Is there a :last-child if I need to include 3 or more paras?


Yes (CSS3 and supported by some browser), but why would you need it here?
--
Anne van Kesteren
<http://www.annevankesteren.nl/>
Jul 20 '05 #4
Iain Hallam wrote:

Thanks. Is there a :last-child if I need to include 3 or more paras?


Not yet. It's proposed in CSS3. (Mozilla and possibly Opera offer
support for a few parts of CSS3. I don't think last-child is one of them.)

--
Brian (follow directions in my address to email me)
http://www.tsmchughs.com/

Jul 20 '05 #5
Brian wrote:
Iain Hallam wrote:

Thanks. Is there a :last-child if I need to include 3 or more paras?

Not yet. It's proposed in CSS3. (Mozilla and possibly Opera offer
support for a few parts of CSS3. I don't think last-child is one of them.)


Mozilla supports ':last-child':
<http://bugzilla.mozilla.org/show_bug.cgi?id=46916>
--
Anne van Kesteren
<http://www.annevankesteren.nl/>
Jul 20 '05 #6
Anne van Kesteren wrote:
Brian wrote:
Not yet. It's proposed in CSS3. (Mozilla and possibly Opera offer
support for a few parts of CSS3. I don't think last-child is one
of them.)


Mozilla supports ':last-child':


Good to know. Thanks for the correction. (And sorry for bad info.)

--
Brian (follow directions in my address to email me)
http://www.tsmchughs.com/

Jul 20 '05 #7
Anne van Kesteren wrote:
Iain Hallam wrote:
Thanks. Is there a :last-child if I need to include 3 or more paras?

Yes (CSS3 and supported by some browser), but why would you need it here?


Good point :-) Umm, "it was a late-night posting"? (Well... no, it
wasn't but I can't have been thinking straight!)

div p {margin-bottom: 0;}
div p:first-child {margin-top: 0;}

seems to work quite nicely in Mozilla Firebird, but IE 6 seems to be
ignoring the :first-child selector and puts a margin above each first
paragraph. Also, the site I'm developing (sample page at
www.bristol-digital.com) has the main content area go white in IE
6.0.2800.1106 (SP1). Is this a problem with my CSS?

- Iain.
Jul 20 '05 #8
Iain Hallam wrote:
IE 6 seems to be ignoring the :first-child selector


Yes, IE/Win can not parse :first-child
Just one of its many css deficiencies.

--
Brian (follow directions in my address to email me)
http://www.tsmchughs.com/

Jul 20 '05 #9
Iain Hallam wrote:
Hi.

I'm displaying some stats in a table and I'd been putting the text
into a <p> tag inside the <td>s:

[snip]

I can't tell whether you got a response. What I use in all my CSSs is:

td > h1:first-child, td > h2:first-child, td > h3:first-child, td >
h4:first-child, td > p:first-child { margin-top: 0; } /* Firebird */

--
Barry Pearson
http://www.Barry.Pearson.name/photography/
http://www.BirdsAndAnimals.info/
http://www.ChildSupportAnalysis.co.uk/
Jul 20 '05 #10
Barry Pearson schrieb:
Iain Hallam wrote:
Hi.

I'm displaying some stats in a table and I'd been putting the text
into a <p> tag inside the <td>s:


[snip]

I can't tell whether you got a response. What I use in all my CSSs is:

td > h1:first-child, td > h2:first-child, td > h3:first-child, td >
h4:first-child, td > p:first-child { margin-top: 0; } /* Firebird */

--
Nicolai Zwar -- http://www.nicolaizwar.com

"I don't post off-topic digests. I consistently ask the antagonists
what their postings have to do with classical music, which happens to be
the topic of this newsgroup."
(Dr. David J. Tholen, Astronomer, in his "Antagonists Digest, Volume
2452972, posted in rec.music.classical)

Jul 20 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Donald Firesmith | last post: by
8 posts views Thread by bearclaws | last post: by
3 posts views Thread by Paul Thompson | last post: by
19 posts views Thread by CMAR | last post: by
4 posts views Thread by He Shiming | last post: by
3 posts views Thread by ajay2552 | last post: by

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.