After 90 char's continue on new line

Hi
Ive output a texbox on screen (#EMAILLOG_Text#) but its continuing all on one line
after 90 char’s Im trying to get it to take a new line and continue for another 90 char’s and so on

any tips?

heres my code if it helps:



<table cellpadding="3">
<tr>
	<td colspan="2"><strong>History</strong></td>
</tr>
<cfquery name="findlog" datasource="#test#">
   select EMAILLOG_To,EMAILLOG_Date,EMAILLOG_Text
   from EMAILLOG
   where REPORT_Key = #getdetail.REPORT_Key#
   AND EMAILLOG_Type = 2
   AND EMAILLOG_ReportType = '#url.reporttype#'
</cfquery>
   <cfif findlog.recordcount>
       <tr class="row4">
	 th align="left">Date</th>
	<th align="left">To</th>
	<th align="left">Text</th>
      </tr>
   </cfif>

<cfloop query="findlog">
      <tr class="#iif(currentrow mod 2, de("row1"), de("row2"))#">
      <td>#dateformat(EMAILLOG_Date,"dd mmm yyyy")# #timeformat(EMAILLOG_Date,"HH:mm")#</td>
      <td>#EMAILLOG_To#</td>
      <td>#EMAILLOG_Text#</td>
    </tr>
</cfloop>
</table>
<br/>

The basic algorithm would be loop from 1 to the total length of the string, in increments of 90 (ie step=90). Then use MID() to display the current block of 90 characters.

But that’s a very crude approach (breaks in the middle of words, etc…). Have a look at the string library at cflib.org for other options.