Forum Moderators: open

Message Too Old, No Replies

Irregular line spacing in IE 7

IE 7 messes up line spacing

         

deMorte

11:33 am on Jan 24, 2008 (gmt 0)

10+ Year Member



I have a PHP- page that renders information on a table cell. The layout of the cell should be:

<td>
<span class="example">
Line 1<br>
Line 2<br>
Line 3
</span>
</td>

Lines 1 and 2 come out right (using the line height defined in CSS -file) but Line 3 comes out much lower.
Line 3 prints out right if I put one more <br> at the end of Line 3.

If anyone has any ideas what causes this behaviour and how it can be fixed, it'd be great.
I'm not too thrilled about using additional breaks in the output.

[edited by: deMorte at 11:33 am (utc) on Jan. 24, 2008]

tedster

8:24 pm on Jan 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is line 3 the widest - coming close to the width of the containing element?

deMorte

7:26 am on Jan 25, 2008 (gmt 0)

10+ Year Member



I have the problem on two different cells, in one the third line is the longest, on the other it is the second longest.
The containing <td> width is much bigger than the need for the lines.

Also I've noticed that IE has a different setting for padding="0" and spacing="0" on tables.
Where FF & Opera print out cells right below each other, IE leaves a space between cells. What's with this?

Madenio

8:34 am on Jan 25, 2008 (gmt 0)

10+ Year Member



First of all, I wouldn't work out this if using <span> element, as it is meant as inline element. Try to use <div> or <p> instead.

deMorte

7:53 am on Jan 28, 2008 (gmt 0)

10+ Year Member



Changing spans to divs seems to do the trick.

Thank you.