By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,492 Members | 1,955 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,492 IT Pros & Developers. It's quick & easy.

Collapsing <p> spacing in a table in Firebird

P: n/a
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
Share this Question
Share on Google+
10 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.