Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Nov 2007
    Posts
    71
    Thanks
    9
    Thanked 0 Times in 0 Posts

    <pre> skips a line?

    I want to display description "as is" which is retrieved from the database (has a fixed length of 30). I used <pre> element and each row skips a line. What am I doing wrong? Here is the code:

    Code:
    <html>
    <head>
    </head>
    <body>
    
    <table cellspacing="0">
    <thead>
      <tr>
        <td>Item No</td>
        <td>Description</td>
      </tr>
    </thead>
    <tbody>
         <tr>
           <td>12314</td>
           <td><pre>TOMATOES               12DZ</pre></td>
         </tr>  
         <tr>
           <td>62323</td>
           <td><pre>BANANAS                24DZ</pre></td>
         </tr>
    </tbody>
    </table>
    
    </body>
    </html>

  • #2
    Regular Coder
    Join Date
    Nov 2006
    Posts
    246
    Thanks
    13
    Thanked 26 Times in 24 Posts
    If you have CSS document, add this to it:

    Code:
    pre { display: inline; }
    or if you don't, add this inside your head tags:

    Code:
    <style type="text/css">
    pre { display: inline; }
    </style>

  • #3
    New Coder
    Join Date
    Nov 2007
    Posts
    71
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Worked. Thanks.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •