<h2><?= esc($form['title']) ?></h2>

<table border="1" cellpadding="6">
    <thead>
    <tr>
        <?php foreach ($fields as $field): ?>
            <th><?= esc($field['label']) ?></th>
        <?php endforeach; ?>
    </tr>
    </thead>
    <tbody>
    <?php foreach ($data as $row): ?>
        <tr>
            <?php foreach ($fields as $field): ?>
                <td><?= esc($row[$field['db_column']] ?? '') ?></td>
            <?php endforeach; ?>
        </tr>
    <?php endforeach; ?>
    </tbody>
</table>
