Hi
I've built a simple message board that uses a text area to submit posts.
Everything works just fine except the text formatting when I present the posts.
At first I was just loading the text from the database and presented it as is in a TD element with no text formatting. I then wanted to make the text look the way it did when it was posted so I inserted the pre element. This works as long as people hit enter every now and then, but if they don't. The table will be stretched out no matter what width I set for the TD and table. Now I want to force a line break or set a max width for the post. I've tried messing around with style and such but it doesn't do anything.
Is there anyway to do this? or is there another work-around?
I'll show the layout of the table I use below just to clear things up a bit. This isn't the excact code I use but very close (I use another language...)
It's the line with RecSet("content") I want to force linebreaks on.
Is there an easy way to do this or do I need to write a function that splits the string up in words and insert <br> at some points?
This might be more of a HTML/CSS question but wasn't sure where to post.
I've built a simple message board that uses a text area to submit posts.
Everything works just fine except the text formatting when I present the posts.
At first I was just loading the text from the database and presented it as is in a TD element with no text formatting. I then wanted to make the text look the way it did when it was posted so I inserted the pre element. This works as long as people hit enter every now and then, but if they don't. The table will be stretched out no matter what width I set for the TD and table. Now I want to force a line break or set a max width for the post. I've tried messing around with style and such but it doesn't do anything.
Is there anyway to do this? or is there another work-around?
I'll show the layout of the table I use below just to clear things up a bit. This isn't the excact code I use but very close (I use another language...)
Code:
<table border="1" width="800">
<tr>
<td><strong>Submitted by: </center> <% =RecSet("User") %> </td>
</tr>
<tr>
<td> <strong>Subject: </strong> <% =RecSet("Subject") %> </td>
</tr>
<tr>
<td width="750"><pre><% =Recset("content") %> </pre> </td>
</tr>
<table>
{/code}
Is there an easy way to do this or do I need to write a function that splits the string up in words and insert <br> at some points?
This might be more of a HTML/CSS question but wasn't sure where to post.