By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,706 Members | 2,046 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,706 IT Pros & Developers. It's quick & easy.

<pre> tag question

P: n/a
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:otherwise><pre> Y </pre></xsl:otherwise>
</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?

--------------------------
| X |
|The Red Badge of Courage|
--------------------------

Thanks,

James

Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a


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

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #2

P: n/a
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

Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.