<pre> tag question

Discussion in 'XML' started by Porthos, Dec 28, 2004.

  1. Porthos

    Porthos Guest

    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?

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

    Thanks,

    James
     
    Porthos, Dec 28, 2004
    #1
    1. Advertising

  2. 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/
     
    Martin Honnen, Dec 28, 2004
    #2
    1. Advertising

  3. Porthos

    Porthos Guest

    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
     
    Porthos, Dec 28, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rocky Moore
    Replies:
    7
    Views:
    1,769
    mikeb
    Jan 14, 2004
  2. =?Utf-8?B?S2V2aW4gQnVydG9u?=

    Pre-Send Request Headers, Pre-Send Request Content

    =?Utf-8?B?S2V2aW4gQnVydG9u?=, Dec 31, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    1,092
    =?Utf-8?B?S2V2aW4gQnVydG9u?=
    Dec 31, 2004
  3. shruds
    Replies:
    1
    Views:
    872
    John C. Bollinger
    Jan 27, 2006
  4. Wladimir Borsov
    Replies:
    7
    Views:
    494
    Raymond Loman
    May 5, 2004
  5. Juha Nieminen
    Replies:
    3
    Views:
    1,175
    Juha Nieminen
    Feb 22, 2008
Loading...

Share This Page