469,964 Members | 1,671 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,964 developers. It's quick & easy.

How to move <PRE> definition inside <TD> ...< /TD> to a stylesheet ?

I want to move the following <PRE> defintion to a css file:

<TABLE><TR><TD><PRE>sample text</PRE></TD>
<TD> not predefined font</TD></TR></TABLE>

should be

<TABLE><TR><TD class=aaa>sample text</TD>
<TD> not predefined font</TD></TR></TABLE>

with

mycss.css containing

TD.aaa { ...... ???? ........... }

Matt

Jul 20 '05 #1
3 7854


Matt Adams wrote:
I want to move the following <PRE> defintion to a css file:

<TABLE><TR><TD><PRE>sample text</PRE></TD>
<TD> not predefined font</TD></TR></TABLE>

should be

<TABLE><TR><TD class=aaa>sample text</TD>
<TD> not predefined font</TD></TR></TABLE>

with

mycss.css containing

TD.aaa { ...... ???? ........... }


td.aaa { white-space: pre; }
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2
Martin Honnen <ma*******@yahoo.de> wrote:
td.aaa { white-space: pre; }


And

td.aaa { font-family: monospace; }

perhaps with some specific fixed-width fonts listed first. The pre
element in HTML preserves white space but it also implies the need for
monospace font, and in CSS, these features are separate.

On the other hand, if it is essential that a table cell be presented
the same way as pre elements, then is it really a CSS affair to say
that? Maybe pre markup is better. Maybe a different approach is needed,
depending on _why_ pre would be used.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 20 '05 #3
Matt Adams <Ma********@email.com> wrote:
I want to move the following <PRE> defintion to a css file: Are you trying to get monospaced text (like Courier)? If so, see below.
TD.aaa { ...... ???? ........... }


td.aaa { font-family: monospace; }
--
Michael Wilcox
mjwilco at yahoo dot com
Essential Tools for the Web Developer - http://mikewilcox.t35.com
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by josh dismukes | last post: by
2 posts views Thread by Porthos | last post: by
5 posts views Thread by spectre | last post: by
38 posts views Thread by Xah Lee | last post: by
1 post views Thread by rainxy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.