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 15 April 2003, 05:25 PM
  #1  
Iain Young
Scooby Regular
Thread Starter
 
Iain Young's Avatar
 
Join Date: Sep 1999
Location: Swindon, Wiltshire Xbox Gamertag: Gutgouger
Posts: 6,956
Likes: 0
Received 0 Likes on 0 Posts
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
Old 15 April 2003, 05:49 PM
  #2  
Hammy Hamster
Scooby Regular
 
Hammy Hamster's Avatar
 
Join Date: Nov 2002
Posts: 15,216
Likes: 0
Received 0 Likes on 0 Posts
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>
Old 15 April 2003, 06:46 PM
  #3  
Iain Young
Scooby Regular
Thread Starter
 
Iain Young's Avatar
 
Join Date: Sep 1999
Location: Swindon, Wiltshire Xbox Gamertag: Gutgouger
Posts: 6,956
Likes: 0
Received 0 Likes on 0 Posts
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]
Old 15 April 2003, 08:15 PM
  #4  
AdrianFRST
Scooby Regular
 
AdrianFRST's Avatar
 
Join Date: Oct 2000
Posts: 368
Likes: 0
Received 0 Likes on 0 Posts
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]
Old 16 April 2003, 12:03 AM
  #5  
Iain Young
Scooby Regular
Thread Starter
 
Iain Young's Avatar
 
Join Date: Sep 1999
Location: Swindon, Wiltshire Xbox Gamertag: Gutgouger
Posts: 6,956
Likes: 0
Received 0 Likes on 0 Posts
Cool

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

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



Quick Reply: Help with some html code please



All times are GMT +1. The time now is 04:19 AM.