List evenly 3 column-count

1

Well I think this is in css what is not my beach, I would like to be listing the results of the bd and pass the next result to the next column

I tried to use (summarized)

SELECT * FROM anuncios ORDER BY data DESC

.recipiente{
-webkit-column-count: 3;
-moz-column-count: 3;
column-count: 3;
-webkit-column-gap: 33px;
-moz-column-gap: 33px;
column-gap: 33px; }

<div class="recipiente"> echo " $texto "; </div>

not successful, EX: the result of one of the lines of the query cuts in half and goes to the next column, to explain and a bit complicated, but I found a site that portrays well what I want to do

    
asked by anonymous 04.06.2015 / 02:56

1 answer

0

You can break your text into columns, example to break into three:

$len = strlen($input);
$space = strrpos($input," ",-$len/3);
$col1 = substr($input,0,$space);
$col2 = substr($input,$space,$space*2);
$col3 = substr($input,$space*2,$space*3);

and use grid .col-sm-4 of bootstrap

The css of this is simple:

.col-md-4 {
    width: 33.33333333%;
    float:left;
}
    
23.08.2015 / 22:51