0
How can I list column values in a "<table>
" ?
I want to list all Rows values in <tr>
as shown in the image
Table code:
<table id="datatable" class="table table-striped table-bordered" cellspacing="0" width="100%">
<thead>
<tr>
<th>BANDEIRA</th>
<th>TIPO</th>
<th>BIN</th>
<th>QUANTIDADE</th>
<th>VENDEDOR</th>
<th class="disabled-sorting text-right">Ações</th>
</tr>
</thead>
<tfoot>
<tr>
<th>BANDEIRA</th>
<th>TIPO</th>
<th>BIN</th>
<th>QUANTIDADE</th>
<th>VENDEDOR</th>
<th class="disabled-sorting text-right">Ações</th>
</tr>
</tfoot>
<tbody>
<tr>
<td>ROW BANDEIRA</td>
<td>ROW TIPO</td>
<td>ROW BIN</td>
<td>ROW QUANTIDADE</td>
<td> ROW VENDEDOR</td>
<td class="text-right">
<a href="#" class="btn btn-info btn-link btn-icon btn-sm like"><i class="fa fa-heart"></i></a>
<a href="#" class="btn btn-warning btn-link btn-icon btn-sm edit"><i class="fa fa-edit"></i></a>
<a href="#" class="btn btn-danger btn-link btn-icon btn-sm remove"><i class="fa fa-times"></i></a>
</td>
</tr>
</tbody>
</table>
</div>
EDIT 2: I need to create a form that makes a POST on the own page with all the values of
<td>
. I tried this way, but I couldn’t:
<form method="POST">
<tbody>
<?php foreach ($resultado as $row) { ?>
<tr>
<td><?php echo $row['a']; ?></td>
<td><?php echo $row['b']; ?></td>
<td><?php echo $row['c']; ?></td>
<td><?php echo $row['d']; ?></td>
<td><?php echo "R$ " . $row['e']; ?></td>
<td><?php echo $row['v']; ?></td>
<td class="text-right">
<input type="submit" value="Info"></input>
</td>
</tr>
<?php } ?>
</form>
Example: Clicking on the INFO button will make a POST with the value of Row A, Row B and all other Rows
Perfect, thank you.
– PLINIO RODRIGUES
Any doubt just call. If you also want to give a positive point my answer I would appreciate :)
– João Pedro Schmitz
I can’t upvote, I don’t have enough reputation.
– PLINIO RODRIGUES
Friend, just one more question. If I wanted to create a "form" for each foreach, to make a POST with the bin, how could I do this ?
– PLINIO RODRIGUES
The form Submit would be the
"<a href="#" class="btn btn-info btn-link btn-icon btn-sm like"><i class="fa fa-heart"></i></a>"
– PLINIO RODRIGUES
I edited the question so you can better visualize how to do it.
– João Pedro Schmitz
I couldn’t understand, I’ll edit my topic, if you can help me, please.
– PLINIO RODRIGUES