1
Good afternoon friends, I’m having trouble assembling a table with result in 2 columns with database information.
<table style='width: 100%;' border='1' cellspacing='0' cellpadding='0'>
<thead>
<tr style='background-color: #CCCCCC;'>
<td style='text-align: center; width: 12.5%; height:20px'><h3>Equipamento locado</h3></td>
<td style='text-align: center; width: 12.5%;'><h3>Patrimônio</h3></td>
</tr>
</thead>
<tbody>
if($cliente->equipamento){
$array_equipamento = explode( "," , $cliente->equipamento ) ;
foreach ($array_equipamento as $value) {
$equipamento = $objeto_equipamento->busca_equipamento($value);
<tr>
<td style='text-align: center; width: 12,5%; height:20px'>$equipamento->nome</td>
<td style='text-align: center; width: 12,5%;'>$equipamento->patrimonio</td>
</tr>
}
}
</tbody>
</table>
<table>
<tr><td>coluna 1 </td> <td> Coluna 2 </td> </tr>
<tr><td> 1 </td> <td> 2 </td></tr>
<tr><td> 3 </td> <td> 4 </td></tr>
<tr><td> 5 </td> <td> 6 </td></tr>
<tr><td> 7 </td> <td> 8 </td></tr>
</table>
The numbers in the example represent the sequence of results for better understanding.
I don’t understand... what code you’re using?
– novic
sorry, I edited the html for better visualization !!!
– Thiago Lopez
We need to know where you get this information?
– novic
mysql database ... comes from query query !!!
– Thiago Lopez
$equipamento
makes so of avar_dump($equipamento)
and glue the result here!– novic
It’s the following, I already receive and I list everything in the table friend, the problem I have is to assemble the result in two columns, only this .... an algorithm to divide into the table
– Thiago Lopez
Thiago, my dear Odson, if you do not pass as the columns of this table, it is difficult to know how to generate the same!
– novic
as I informed you, the important thing is not my data but how to present the result divided in 2 columns, if you get the algorithm I apply in my code !!
– Thiago Lopez
it’s complicated to give a
var_dump
?– novic
@Thiagolopez Only with the data provided is it impossible to propose a solution.
– Maujor
I edited the code, if it is simple for you like this ! As you can see this listing in two columns with two information, however I want you to have two more columns on the right and list 2 records per row to take advantage of the sheet size.
– Thiago Lopez