Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

Help with some html code please

Thread Tools
 
Search this Thread
 
Old Apr 15, 2003 | 05:25 PM
  #1  
Iain Young's Avatar
Iain Young
Thread Starter
Scooby Regular
 
Joined: Sep 1999
Posts: 6,956
Likes: 0
From: Swindon, Wiltshire Xbox Gamertag: Gutgouger
Question

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
Reply
Old Apr 15, 2003 | 05:49 PM
  #2  
Hammy Hamster's Avatar
Hammy Hamster
Scooby Regular
 
Joined: Nov 2002
Posts: 15,216
Likes: 0
Lightbulb

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>
Reply
Old Apr 15, 2003 | 06:46 PM
  #3  
Iain Young's Avatar
Iain Young
Thread Starter
Scooby Regular
 
Joined: Sep 1999
Posts: 6,956
Likes: 0
From: Swindon, Wiltshire Xbox Gamertag: Gutgouger
Post

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]
Reply
Old Apr 15, 2003 | 08:15 PM
  #4  
AdrianFRST's Avatar
AdrianFRST
Scooby Regular
 
Joined: Oct 2000
Posts: 368
Likes: 0
Post

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]
Reply
Old Apr 16, 2003 | 12:03 AM
  #5  
Iain Young's Avatar
Iain Young
Thread Starter
Scooby Regular
 
Joined: Sep 1999
Posts: 6,956
Likes: 0
From: Swindon, Wiltshire Xbox Gamertag: Gutgouger
Cool

Aha, that did the trick, (didn't think to check the margins).

Thanks for the help,
Iain
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Darrell@Scoobyworx
Trader Announcements
26
Jan 30, 2024 01:27 PM
shorty87
Full Cars Breaking For Spares
19
Dec 22, 2015 11:59 AM
Mad Hammer
Subaru Parts
2
Sep 29, 2015 08:15 PM
madmover
Member's Gallery
4
Sep 28, 2015 10:46 AM
shorty87
Other Marques
0
Sep 25, 2015 08:52 PM




All times are GMT +1. The time now is 02:50 PM.