Help with some html code please
#1
Scooby Regular
Thread Starter
Join Date: Sep 1999
Location: Swindon, Wiltshire Xbox Gamertag: Gutgouger
Posts: 6,956
Likes: 0
Received 0 Likes
on
0 Posts
Hi folks, I'm having some trouble with internet explorer and was wondering if there was a way around it. Basically I'm trying to put some pre-formatted text inside a table cell...
<tr><td><pre>Text for line 1</pre></td></tr>
<tr><td><pre>Text for line 2</pre></td></tr>
<tr><td><pre>Text for line 3</pre></td></tr>
etc...
Seems simple enough, and it works fine on Netscape, but for some bizarre reason, Internet explorer seems to be putting a carriage return at the end of each </pre> and so I am getting blank lines in between the displayed text.
Any ideas how to get around this?
Thanks,
Iain
<tr><td><pre>Text for line 1</pre></td></tr>
<tr><td><pre>Text for line 2</pre></td></tr>
<tr><td><pre>Text for line 3</pre></td></tr>
etc...
Seems simple enough, and it works fine on Netscape, but for some bizarre reason, Internet explorer seems to be putting a carriage return at the end of each </pre> and so I am getting blank lines in between the displayed text.
Any ideas how to get around this?
Thanks,
Iain
#2
Something like this should work...
<pre><tr><td>Text for line 1</td></tr>
<tr><td>Text for line 2</td></tr>
<tr><td>Text for line 3</td></tr></pre>
<pre><tr><td>Text for line 1</td></tr>
<tr><td>Text for line 2</td></tr>
<tr><td>Text for line 3</td></tr></pre>
#3
Scooby Regular
Thread Starter
Join Date: Sep 1999
Location: Swindon, Wiltshire Xbox Gamertag: Gutgouger
Posts: 6,956
Likes: 0
Received 0 Likes
on
0 Posts
Thanks, but it doesn't seem to. If the <pre> is outside of the table cell, then the contents don't seem to get formatted. For example....
<pre><tr><td>Hello __________ World</td></tr></pre>
(replace _ characters with spaces) gets rendered as...
Hello World
(i.e. all the spaces are omitted). Really frustrating this one...
Iain
[Edited by Iain Young - 4/15/2003 6:48:04 PM]
<pre><tr><td>Hello __________ World</td></tr></pre>
(replace _ characters with spaces) gets rendered as...
Hello World
(i.e. all the spaces are omitted). Really frustrating this one...
Iain
[Edited by Iain Young - 4/15/2003 6:48:04 PM]
#4
Just replace <pre> with <pre style="margin: 0px;">
If you're using CSS (inline or linking to an external stylesheet) then just add:
pre
{
margin: 0px;
}
In there.
[edit: spelling]
[Edited by AdrianFRST - 4/15/2003 8:15:50 PM]
If you're using CSS (inline or linking to an external stylesheet) then just add:
pre
{
margin: 0px;
}
In there.
[edit: spelling]
[Edited by AdrianFRST - 4/15/2003 8:15:50 PM]
Thread
Thread Starter
Forum
Replies
Last Post
shorty87
Full Cars Breaking For Spares
19
22 December 2015 11:59 AM