You can easily split the text into two parts in PHP:
$text = "my very long text with a lot of words"; $length = strlen($text); $middle = round($length/2, 0); $col1 = substr($text, 0, $middle); $col2 = substr($text, $middle);
But these motives often shorten the phrase in the middle of the word. Therefore, you will need to update the code to find the nearest space in the middle:
for ($i = $middle; $i < $length; $i ++) { if ( substr($text, $i, 1) == " " ) return; } $cut = $i; $col1 = substr($text, 0, $cut); $col2 = substr($text, $cut+1);
Space is not the only place for beautiful text. So you have to look for the ends of the line. And some spaces are not good either. For example, a space before a comma. Therefore, you will improve this code to improve results.
You can also try the css3 multi-column directive: http://www.css3.info/preview/multi-column-layout/ but this note is supported by IE.
source share