close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Repeating table wrap text

Thread began 7/17/2011 2:17 pm by john70964 | Last modified 7/18/2011 6:22 pm by Jason Byrnes | 1030 views | 7 replies |

john70964

Repeating table wrap text

I have a repeating table which contains a text field. Some of the entries are a little to long to allow a good fit within the cell. I wondered if there was a way I could cause the text to wrap around in the cell after say 50 characters?
Thanks

John

Sign in to reply to this post

anonymous

Sure... you could simply add the php word wrap command as follows:

php:
$text = $row_yourQuery['textcolumn'];

$text = wordwrap($text, 50, "\n", true);
echo $text;



The command is wordwrap. You'll notice the "50" is designated for the number of characters. Then comes the line break. Use "true" if you want it to break apart words and "false" if you want to leave words complete before break.

Best regards,

Brian

Sign in to reply to this post

john70964

Many thanks Brian

The code I have for the text is
<?php echo $row_rsCategory['ProductName']; ?>

can you please indicate how I apply your code
$text = $row_yourQuery['textcolumn'];
$text = wordwrap($text, 50, "\n", true);
echo $text;
to this field?

As you can guess I am a complete newbie with php

Sign in to reply to this post

Jason ByrnesWebAssist

change your code:

php:
<?php echo $row_rsCategory['ProductName']; ?>



to:

php:
<?php echo(wordwrap($row_rsCategory['ProductName'], 50"\n"true)); ?>
Sign in to reply to this post

john70964

Thank you for the help.

I placed the new code in and changed the length to 30 and tried 40 characters but the number of letters in the field do not seem to change. Did I do something wrong please?

Please see attached images for details

Sign in to reply to this post

Jason ByrnesWebAssist

try using this code then:

php:
<?php echo(wordwrap($row_rsCategory['ProductName'], 50"<br />\n"true)); ?>
Sign in to reply to this post

john70964

Yes that "<br />\n" did the trick.

Many thanks for the help.

Regards

John

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...