...

View Full Version : <pre> skips a line?



chikna
01-04-2008, 01:43 AM
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:



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

Majoracle
01-04-2008, 01:56 AM
If you have CSS document, add this to it:


pre { display: inline; }

or if you don't, add this inside your head tags:


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

chikna
01-04-2008, 02:14 AM
Worked. Thanks.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum