For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > September 2006 > display text in 2 cols -possible?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author display text in 2 cols -possible?
ashok

2006-09-27, 6:58 pm

I call text from mysql.
Is it possible to display the text in 2 columns?


ikciu

2006-09-28, 6:56 pm

Zebrawszy mysli ashok <ashok@replyhere.com> wyklepal:
> I call text from mysql.
> Is it possible to display the text in 2 columns?


It is ...


--
~~~~~~~~~~~
Ikciu
gg: 718845
www: www.e-irsa.pl


DonO

2006-09-28, 6:56 pm


ashok wrote:
> I call text from mysql.
> Is it possible to display the text in 2 columns?


Should be. I'm not sure exactly what you're trying to say, but if you
mean to retrieve a block of text and then format in 2 columns using CSS
or a table, etc. you could do something like....

1) Query MySQL to get the text you want as $text_block;

2) Get the length or word count of $text_block and divide it by two
(being careful not to split a word)

3) Put the first half in one <div> or <td> and the remainder in the
other.

Hope that helps. Provide more info and I may have a better answer.

Cheers,
D.

ashok

2006-09-28, 6:56 pm


"DonO" <don.orban@gmail.com> ???????/???????? ? ???????? ?????????:
news:1159473225.404889.232540@k70g2000cwa.googlegroups.com...
>
> ashok wrote:
>
> Should be. I'm not sure exactly what you're trying to say, but if you
> mean to retrieve a block of text and then format in 2 columns using CSS
> or a table, etc. you could do something like....
>
> 1) Query MySQL to get the text you want as $text_block;
>
> 2) Get the length or word count of $text_block and divide it by two
> (being careful not to split a word)
>
> 3) Put the first half in one <div> or <td> and the remainder in the
> other.
>
> Hope that helps. Provide more info and I may have a better answer.
>
> Cheers,
> D.
>


yes, it is something like you mentioned. the website design needs to split
text in columns (2 and 3 columns depending on the page). it will be more
suitable to use table.
so, i currently have <?php echo $row_rsindexpage['text_page']; ?>
what gives me , say lorem ipsum text on the page. since i don't know what
the exact volume of text will be, i need to display the text in 2 or 3
columns , so that each column has app. same height.

i basically understand what you say, but since i am newbie, can u tell me
what functions i need ( especially- being careful not to split a word).







ashok

2006-09-29, 6:57 pm

ok, i can get the word count, but i don't know how to spilt the actual text
in columns. Also, when I divide the word count, i get somwthing like 247.5
How should I actually divide the text, what function i should use?


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com