<pre> tag question

Porthos

Usenet Archive
Joined
Dec 23, 2004
Messages
19
Reaction score
0
Hi All,

I'm building an XSL document that puts two types of

information in a table dimension: preformatted data and data

extracted from my XML document (see below)

<table>
<tr>
<td>
<xsl:choose>
<xsl:when test="@amount=0"><pre> X </pre></xsl:when>
<xsl:eek:therwise><pre> Y </pre></xsl:eek:therwise>
</xsl:choose>
<u><xsl:value-of select="@title" /></u>
</td>
</tr>
</table>

The output is in a <td>, but it shows up on two separate

lines. Is there any way to make it show up as one continious line?

When I remove the <pre> tags, everything is on one line, but I lose

the formatting. Is this a 'by design' feature of the <pre> tag?
 

Martin Honnen

Usenet Archive
Joined
Apr 8, 2000
Messages
6,174
Reaction score
0
Porthos wrote:

The output is in a <td>, but it shows up on two separate

lines. Is there any way to make it show up as one continious line?

When I remove the <pre> tags, everything is on one line, but I lose

the formatting. Is this a 'by design' feature of the <pre> tag?

That is a HTML question, see the HTML 4.01 specification <http://www.w3.org/TR/html4/struct/text.html#h-9.3.4> HTML 4.01 knows block-level and inline elements <http://www.w3.org/TR/html4/struct/global.html#h-7.5.3> and <pre> is a block-level element.
 

Porthos

Usenet Archive
Joined
Dec 23, 2004
Messages
19
Reaction score
0
For those who are interested, following Martin's advice I read up on block vs inline elements and came up with the CSS below:

<!-- CSS Stylesheet -->
<style type="text/css">
pre { display: inline; }
</style>
<!-- End CSS Stylesheet -->

Thanks Martin

-James
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,042
Messages
3,104,223
Members
248,131
Latest member
Tonypshaw1

Latest Threads

Top