2
I have a table that returns several records.
Table Code:
<table>
<thead>
<tr>
<th>N° Prog</th>
<th>Data Opr</th>
<th>Origem</th>
<th>Destino</th>
<th>Remetente</th>
<th>Peso</th>
<th>Peso Total</th>
<th>Destinatário</th>
<th>Previsão de Chegada</th>
<th>Veículo</th>
<th>Placa</th>
<th>Motorista</th>
<th>Observação</th>
<th>St</th>
</tr>
</thead>
<tbody>
<?php foreach ($controller->ListaTudo($objProg) as $objProg){ ?>
<tr>
<td><?php echo $objProg->getprog(); ?></td>
<td><?php echo $objProg->getdataopr(); ?></td>
<td><?php echo $objProg->getorig(); ?></td>
<td><?php echo $objProg->getdest(); ?></td>
<td><?php echo $objProg->getremetente(); ?></td>
<td><?php echo $objProg->getpeso(); ?></td>
<td><?php echo $objProg->getpesottl(); ?></td>
<td><?php echo $objProg->getdestinatario(); ?></td>
<td><?php echo $objProg->getprev(); ?></td>
<td><?php echo $objProg->getplaca(); ?></td>
<td><?php echo $objProg->getcarreta(); ?></td>
<td><?php echo $objProg->getmot(); ?></td>
<td><?php echo $objProg->getobs(); ?></td>
<td><?php echo $objProg->getst1(); ?></td>
</tr>
<?php } ?>
</tbody>
</table>
I need that when the N° Prog (in case the three 74 numbers in the image) are equal, type one rowspan
in td
, that there is only one "74" but the rest remains 3 lines. However, there will not always be 3 equal records, there may be more or only one.
Create a logic first, counting the same values and save as rowspan, before mounting the
foreach
. After, do the assembly bringing this result.– William Aparecido Brandino