in reply to Wordwrap text
You should rely on HTML to do this - just specify the
width of the column, preferably with a percentage:
The following _hack_ will work, but it's nasty:
Thanks nardo - that's what i get for changing my code from the testing board to the posting board (this cleverness thing just isn't working out for me today). Besides, a ternary operator in void context is evil. . . .
UPDATE:<td width="25%">big long sentance . . .</td>
The following _hack_ will work, but it's nasty:
UPDATED UPDATE:use constant POS => 10; my $str = 'big old long sentance blah blah blah'; my $len; foreach (split(/\s/,$str)) { $len += length; print; ($len % POS) ? print ' ' : print '<br>'; }
Thanks nardo - that's what i get for changing my code from the testing board to the posting board (this cleverness thing just isn't working out for me today). Besides, a ternary operator in void context is evil. . . .
#inside foreach $len += length; print; if ($len > POS) { # thanks nlafferty print '<br>'; $len = 0; } else { print ' '; }
Jeff
R-R-R--R-R-R--R-R-R--R-R-R--R-R-R--
L-L--L-L--L-L--L-L--L-L--L-L--L-L--
In Section
Seekers of Perl Wisdom