To properly display long text in php

Thread Solved

Join Date: Sep 2009
Posts: 24
Reputation: lcyew is an unknown quantity at this point 
Solved Threads: 0
lcyew lcyew is offline Offline
Newbie Poster

To properly display long text in php

 
0
  #1
Oct 6th, 2009
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
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 608
Reputation: OmniX is an unknown quantity at this point 
Solved Threads: 8
OmniX's Avatar
OmniX OmniX is offline Offline
Practically a Master Poster
 
-1
  #2
Oct 6th, 2009
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.
"You never stop learning." - OmniX
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 525
Reputation: network18 is an unknown quantity at this point 
Solved Threads: 61
network18 network18 is offline Offline
Posting Pro
 
0
  #3
Oct 6th, 2009
or else u can just specify the amount of words you want par line with 'wordwrap()' like below -
  1. $wordParLine = 10;
  2. wordwrap($string', $wordParLine);
  3.  
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 24
Reputation: lcyew is an unknown quantity at this point 
Solved Threads: 0
lcyew lcyew is offline Offline
Newbie Poster
 
0
  #4
Oct 7th, 2009
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 ^_^
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC