Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Change behaviour of <PRE> Tag

0 views
Skip to first unread message

Benjamin Kalytta

unread,
Mar 9, 2002, 8:20:00 AM3/9/02
to
How can I change the behaviour of the <PRE> TAG?
Let me explain how it should be changed.
Usually text within <PRE> tag is rendered as it is, it means
spacing will be automatically treated as &nbsp;, and linebreaks
will be treated as <br>. But the big Problem I've is, that
no word wrapping or line breaks occurs if text is rendered in
brwoser.

<pre> within <td> tag should not exceed the width of the whole table.
Word wrapping should automatically occur. Any ideas how to do this?

rg
Benjamin

_______________________________________________
To eMail me please read http://fight.at/spaming


Benjamin Kalytta

unread,
Mar 9, 2002, 8:22:11 AM3/9/02
to
Alternatively I would change the behaviour of the <P> Tag in this way
that all spaces will be treated as &nbsp; and all linebreaks will be
treated as <br>. May be this is easier?

rg
Benjamin K.

Amy[MS]

unread,
Mar 9, 2002, 6:05:57 PM3/9/02
to
Hi Benjamin,

Word wrapping doesn't work with <pre> tag.

Thanks,
Amy


This posting is provided “AS IS” with no warranties, and confers no rights

Benjamin Kalytta

unread,
Mar 9, 2002, 9:19:58 PM3/9/02
to
> Word wrapping doesn't work with <pre> tag.
>
Yes this is my problem.

Frederic Claux

unread,
Mar 10, 2002, 7:57:23 AM3/10/02
to
Maybe you could attach a behavior to the PRE tag and alter its content from
the oncontentready event ?

--
Frederic Claux

"Benjamin Kalytta" <spa...@fight.at> a écrit dans le message de news:
a6d2b1$r5b$04$1...@news.t-online.com...

Konstantin Breu

unread,
Mar 16, 2002, 9:19:04 PM3/16/02
to
Hi,
you can change the behavior with the white-space css attribute, but you will
need IE6 for it Please note that you have to use the doc type header to get
the property working.

see
http://msdn.microsoft.com/library/?url=/workshop/author/dhtml/reference/prop
erties/whitespace.asp


Example:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 //EN"
"http://www.w3.org/TR/REC-html40/strict.dtd">
<html>
<body>

<pre>
&lt;pre&gt;
test test test test
test test test test
test test test test
test test test test
</pre>


<pre style="white-space: normal">
&lt;pre style="white-space: normal"&gt;
test test test test
test test test test
test test test test
test test test test
</pre>

<p>
&lt;p&gt;
test test test test
test test test test
test test test test
test test test test
</p>

<p style="white-space: pre">
&lt;p style="white-space: pre"&gt;
test test test test
test test test test
test test test test
test test test test
</p>

</body>
</html>

Regards,
Konstantin

--
PIRONET NDH
Dipl.-Wirtschaftsmathematiker Konstantin Breu - Senior Consultant - SBU
Software
Josef-Lammerting-Allee 14-18 - 50933 Cologne - Germany
Tel.: +49 (0)221-770 1801 - Fax: +49 (0)221-770 1005
mailto:kb...@pironet.com - http://www.pironet-ndh.com

Besuchen Sie PIRONET NDH auf der CeBIT 2002 in Hannover, Halle 6, Stand C
04, vom 13. bis 20. März.
Visit PIRONET NDH at CeBIT 2002 in Hannover, hall 6, booth C 04, from March
13th to 20th.


"Benjamin Kalytta" <spa...@fight.at> wrote in message
news:a6d26v$bd6$05$1...@news.t-online.com...

0 new messages