List as equal 3 column-Count

Asked

Viewed 80 times

1

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

tried to use ( abridged)

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>

unsuccessfully, EX: the result of one of the query lines cuts in half and goes to the next column, even to explain and more complicated I found a site that depicts well what I am wanting to do

inserir a descrição da imagem aqui

  • You can confirm that it is not the SQL query that is truncating the ad text (running the direct query e.g. from the command line or phpMyAdmin/phpPgAdmin/SQL Management Studio)?

  • yes, it is not the query because the results are being displayed correctly,

1 answer

0

Voce 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;
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.