Wrapping text within a table

liunx

Guest
I have a form that has an input box for users comments, in other words it can have a lot of text. I'm then posting the form to another page, this page then displays the form content in a table.<br />
<br />
My problem is when I put the 'comments' text in a <td> it just expanding the cell and table distorting everything.<br />
<br />
I want the table or cell to be fixed, am I being stupid because everything I do doesn't work!!!!!<br />
<br />
Any suggestions will be greatly appreciated.<br />
<br />
Thanks.<br />
<br />
Nick<!--content-->Have you tried giving the width of the table elements?<br />
<br />
Like this:<br />
<TD Width="10%">Text</TD><br />
<TD Width="50%">More Text</TD><br />
<TD Width="40%">Even more text</TD><!--content-->Originally posted by nickcrispini <br />
I have a form that has an input box for users comments, in other words it can have a lot of text. I'm then posting the form to another page, this page then displays the form content in a table.<br />
<br />
My problem is when I put the 'comments' text in a <td> it just expanding the cell and table distorting everything.<br />
<br />
I want the table or cell to be fixed, am I being stupid because everything I do doesn't work!!!!!<br />
<br />
Any suggestions will be greatly appreciated.<br />
<br />
Thanks.<br />
<br />
Nick <br />
what code are you using on the second page?<!--content-->ASP VBscript.<br />
<br />
All I want is to just <% response.write(commentsText)%> into a <td> and without the <td> expanding its width but instead its height as it wraps.<br />
<br />
Any suggestions?<!--content-->Originally posted by scoutt <br />
what code are you using on the second page? <br />
show us please<!--content-->Hi there nickcrispini, <br />
I want the table or cell to be fixed<br />
In that case you could try this....<table border="1" width="202"height="202"><tr><td ><br />
<div style="width:200;height:200;overflow:auto"><br />
<table border="0"width="200"height="200"><tr><td >your form content goes here<br />
</td></tr></table><br />
</div><br />
</td></tr></table>...if the content Overflows then you will automatically get scrollbars, thus preserving the table dimensions :D<br />
<br />
coothead<!--content-->hey coot, I noticed on a few posts alredy that you ned to watch your spacing.<br />
<br />
table border="1" width="202"height="202"><tr><td ><br />
<br />
some browsers will treat that as 1 parameter and won't render it as you expect. just an FYI ;)<!--content-->Hi there scoutt,<br />
<br />
Thanks for pointing out my error....I have become a little bit sloppy of late :o <br />
<br />
nickcrispini,<br />
<br />
My reply should have looked like this :D....<table border="1px" width="202px"><tr><td><br />
<div style="width:200px; height:200px; overflow:auto;"><br />
<table width="200px"><tr><td>your form content goes here<br />
</td></tr></table><br />
</div><br />
</td></tr></table> <br />
<br />
coothead<!--content-->I've tried the above suggestions to no avail!!!<br />
<br />
Posted by scoutt <br />
"what code are you using on the second page?"<br />
<br />
To answer your question 'scoutt'<br />
<br />
I take the text from the form post, put it into a variable and write the variable into a table cell:<br />
<br />
<%<br />
comments = request.form("userComments")<br />
%><br />
<br />
<table width="300 "border="0"><br />
<tr><br />
<td><br />
<% response.write(comments) %><br />
</td><br />
</tr><br />
</table><br />
<br />
Surely there is a simple way of fixing a table cells width as its a real problem when it just expands distorting everything??????????????<br />
<br />
Help!<!--content-->how is 1 table going to distort everything?<br />
<br />
is the code that is being submitted one continous line?<br />
<br />
you know if you want us to help you have to show us the second page. showing one table will not cut it.<!--content-->The code I wrote is on the second page.<br />
<br />
Yes, it is one continous line of text (no returns). The user writes their comments in a 'textarea' within a form, most people don't return at the end of each line as the text naturally wraps within the 'textarea'. The form is then posted.<br />
<br />
----------------------------<br />
<br />
--commentPage.asp<br />
<br />
<form name="commentsForm" method="post" action="commentResults.asp"><br />
<textarea name="userComments"></textarea><br />
</form><!--content-->so you are talking like this<br />
<br />
djkafjdkafjdafdjkajkajgdkafjdkafjdk;ajdk;ajfkdajfkdla<br />
<br />
<br />
all the way down? that is one continious line, correct? then there is no way html can break that. use ASP to count how many characters you want then break it apart.<br />
<br />
I am not talking returns. html will break code at the spaces, if there is no space in the text then html can't break those.<br />
<br />
if there are spaces and if you set the width of the table then the table will not expand.<br />
<br />
take this forum for example, you type in once continious line and don't hit return and the text is wrapped in a table cell on the next page, nothing special is done.<br />
<br />
add this in the textarea tag wrap="virtual" but that shouldn't be the problem.<!--content-->
 
Back
Top