Hi!

I'm having some problem in displaying long varchar retrieved from database on the interface.

When the text is very long, it causes the interface to stretch horizontally to display the whole text.

I've tried to use text field to display them. It can restrict the display of text in the field, but it looked a bit weird and not really nice to display text.

Is there any way to properly display the long text without affecting the interface?

Thanks in advance. Have a nice day:)

Recommended Answers

All 3 Replies

Depending on the browser but your best bet is to use a div tag and use css to set the width of the div tag. Let me know how it goes.

or else u can just specify the amount of words you want par line with 'wordwrap()' like below -

$wordParLine = 10;
wordwrap($string', $wordParLine);

Hi guys...

Omnix, sorry for not trying your way, because i don't quite get what you mean by that. But thanks anyway.

network18, I've tried the wordwrap function and it's working. Thanks.

Thanks for suggesting solutions..it's greatly appreciated...Nice day ^_^

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.