<pre> tag question

P

Porthos

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?
 
M

Martin Honnen

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.
 
P

Porthos

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
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top