Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

jefersontbss

exiber conteudo em colunas

Recommended Posts

na verdade não e bem isso preciso fazer tipo um jornal exibir o texto em colunas

 

ate agora fiz assim consegui criar 3 colunas mais n consegui fazercom q o texto continue na outra coluna

 

 

<?php @include"admin/config.php";

 

$sql = mysql_query("select * from noticias order by codseq desc limit 12");

$iii = mysql_fetch_assoc($sql);

?>

<table width="100%" border="1">

<tr>

 

 

 

 

<?php

$inicio = 0;

 

function limitarTexto($texto, $limite){

$texto = substr($texto, 0, strrpos(substr($texto, $inicio, $limite),' ')) . '...';

return $texto;

 

}

 

 

 

 

 

$num_caracteres = strlen($iii['noticia']);

$qtd = 3;

$total = ($num_caracteres / $qtd);

$string = utf8_encode($iii['noticia']);

$inicio = ($inicio + $total);

 

while ($ii = mysql_fetch_array($sql)){

for($i = 1; $i <= $qtd ;$i++){

if(($i / $qtd )== 0){

 

 

}else{

 

 

echo"</tr> <tr> ";

 

echo $num_caracteres; for($i = 1; $i <= $qtd ;$i++){

echo $inicio;

echo"<td>";

echo limitarTexto($string, $limite = $total);

 

echo "</td>";

}

 

}

 

}

 

 

}

?>

 

</tr>

</table>

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.