I want my table to look like this image:
My table looks like this image:
So, how to do that?
How my table is generated:
<table id="chiru_inv" class="table table-striped table-hover table-bordered table-responsive">
<tr>
<td colspan="4" align="center">
<h1>Company</br><span style="font-size: 75%;">Number</span></h1>
</td>
<tr>
<td colspan="2">
<h3><span style="float: left;">Bill No.: 4</span></h3>
</td>
<td colspan="2">
<h3><span style="float: right;">Date: </span></h3>
</td>
</tr>
</tr>
<tr>
<td colspan="4">
<h3>Customer: </h3>
</td>
</tr>
<tr>
<th>Sr.</th>
<th>Item</th>
<th>Qty</th>
<th>Amount</th>
</tr>
<?php
$i = 0;
$total = 0;
while($rowc)
{
extract($rowc);
$i++;
?>
<tr>
<td style="border-top:none !important; border-bottom:none !important;">
<?php echo $i; ?>
</td>
<td style="border-top:none !important; border-bottom:none !important;">
<?php
$itm = $IRN;
$stmti = $user_home->runQuery('SELECT * FROM item WHERE IRN = :iinv ');
$stmti->bindParam(':iinv',$itm);
$stmti->execute();
$rowci = $stmti->fetch(PDO::FETCH_ASSOC);
echo $rowci['Name'];
$srv = $SRN;
$stmts = $user_home->runQuery('SELECT * FROM service WHERE SRN = :sinv ');
$stmts->bindParam(':sinv',$srv);
$stmts->execute();
$rowcs = $stmts->fetch(PDO::FETCH_ASSOC);
?>
(<?php echo $rowcs['Name']; ?>)
</td>
<td style="border-top:none !important; border-bottom:none !important;">
<?php echo $Quantity; ?>
</td>
<td style="border-top:none !important; border-bottom:none !important;">
<?php echo $Amnt; ?>
</td>
</tr>
<?php
$total = $total + $Amnt;
$rowc=$stmt->fetch(PDO::FETCH_ASSOC);
}
?>
<tr>
<td colspan="2"><strong><?php echo getIndianCurrency($total); ?>Only</strong></td>
<td><strong>Total:</strong></td>
<td><strong><?php echo $total; ?></strong></td>
</tr>
</table>
The table can have only 1 row, or 2 or it can have 4 rows also!
For all the rows, table should always be like this only.
The rows of the table change according to the records in the database.