<!DOCTYPE html>
<html>
<head>
    <style>
        table { width: 100%; border-collapse: collapse; }
        th, td { border:1px solid #000; padding:6px; font-size:12px; }
    </style>
</head>
<body>

<h3>Data Santri</h3>

<table>
<tr>
    <th>No</th>
    <th>Nama</th>
    <th>NIS</th>
    <th>Kelas</th>
    <th>Alamat</th>
    <th>Nama Wali</th>
    <th>No WA</th>
    <th>Email</th>
    <th>Tahun Masuk</th>
    <th>Kamar</th>
    <th>Gedung</th>
    <th>Jumlah Kumjungan</th>
</tr>

<?php
    $no = 1; 
    foreach ($siswa as $s) { ?>
<tr>
    <td><?= $no ?></td>
    <td><?= $s->nama ?></td>
    <td><?= $s->nis ?></td>
    <td><?= $s->nama_kelas ?></td>
    <td><?= $s->alamat ?></td>
    <td><?= $s->nama_wali ?></td>
    <td><?= $s->nomor_whatsapp ?></td>
    <td><?= $s->email ?></td>
    <td><?= $s->tahun_masuk ?></td>
    <td><?= $s->nama_kamar ?></td>
    <td><?= $s->nama_gedung_kamar ?></td>
    <td><?= $s->jumlah_kunjungan ?></td>
</tr>
<?php $no++; } ?>

</table>
</body>
</html>
