PDA

Click to See Complete Forum and Search --> : 2 small questions


sythe
Mar 10th, 2001, 10:59 AM
Hi, please try and help with either or both of these questions, they are really beginning to bug me now :(

Question 1:
I have a perl script that writes the contents of a <textarea> to an HTML page....
Problem is that I need it to include line breaks..

e.g. <textarea>
line1
line2
line3
</textarea>

should be printed as:
line1
line2
line3

but currently looks like: line1 line2 line3......
Does anyone know how i can change the <textarea> carriage returns to '<br>'s?
preferably using the syntax:
$text =~ s/ (something here) /<br>/g;


Question 2:
I have a table:
<table BORDER=0 CELLSPACING=5 CELLPADDING=3>
<tr BGCOLOR="#5954C5"><td width="750"></td></tr>
</table>

Now i need the table to wrap any text that would make it wider then the specified 750 pixils. Anyone have any idea how this could be done?

Thanks
Sythe

Mar 16th, 2001, 09:02 PM
for Q. #2

if you set the table to the specified width, then the TD will automatically wrap the text if it is that wide. if you make the table shorter than the text it will shorten the text in the table data.

As far as Q #1 you have to wait till I get home. I think I have what your talking about.

does the perl script taking the text form a text file or is it in the script? if it is in the script you can just put <br> in it.

Scoutt