Solved

Wrapping Output

Posted on 2006-06-11
3
274 Views
Last Modified: 2008-02-01
Hello,

I am working with a friend to make a small DB program.  I am the content writer, she is the programmer.  We've come up against a small program that we're hoping someone can help with.

The output of the data is in a kind of table, like a classified ads list.  The problem we are having is wraping the output.

If someone puts in a long unbroken string of text, it distorts the whole layout of the page.  Is there any special command of code we should be using on the cells or elsewher to force wrap the output from tables?

Put another way - when the mysql table is queried and displays its contents, is there any way to force that contents to always wrap to a certain width?

Thanks so much!

Ubee...
0
Comment
Question by:a466-ub52
3 Comments
 
LVL 30

Accepted Solution

by:
todd_farmer earned 250 total points
ID: 16882495
Not in an easy-to-use built-in MySQL function, no - this type of data manipulation is best done at the application layer.  You can limit the number of characters returned by doing something like SUBSTR(columnname, 200).
0
 
LVL 19

Assisted Solution

by:Kim Ryan
Kim Ryan earned 250 total points
ID: 16883007
Yes, you need to take the text output from the database and insert some non breaking spaces ( ) at the point of HTML creation. Alternatively you could filter the user input to prevent long strings from every being entered. This could easily be done with javascript.
0
 

Author Comment

by:a466-ub52
ID: 16883102
Thank you both very much!
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

More Fun with XML and MySQL – Parsing Delimited String with a Single SQL Statement Are you ready for another of my SQL tidbits?  Hopefully so, as in this adventure, I will be covering a topic that comes up a lot which is parsing a comma (or other…
Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now