<style type="text/css">
table {
	border-collapse: collapse;
}

th {
	border: 1px solid #000;
}
.border {
	border: 1px solid #000;
}
</style>

<table>
<tr>
	<td colspan="4">{{ $judul }}</td>
</tr>
<tr>
	<td colspan="2">Priode</td>
	<td colspan="2">: {{ $periode }}</td>
</tr>
</table>
<br>
<table>
	<thead>
		<tr>
			<th>No</th>
			<th>Kode</th>
			<th>Nama Akun</th>
			<th>Jumlah</th>
		</tr>
	</thead>
	<tbody>
		<?php
		$total = 0;
		$no = 1;
		if(sizeof($data) > 0){
			foreach($data as $d){
				echo "<tr>
						<td class='border'>".$no."</td>
						<td class='border'>".$d->kode_perkiraan."</td>
						<td class='border'>".$d->nama_perkiraan."</td>
						<td class='border'>".$d->total_ttl."</td>
					</tr>";
				$no++;
				$total += $d->total_ttl;
			}
		}
		?>
		<tr>
			<td colspan="3" style="text-align: right;" class="border">Total Order Service</td>
			<td class="text-right border"><?= $total ?></td>
		</tr>
	</tbody>
</table>