<div class="table-wrap">
    <table>
        <thead><tr><th>Name</th><th>Loads</th><th>Miles</th><th>Revenue</th></tr></thead>
        <tbody>
            <?php foreach ($rows as $row): ?>
                <tr><td><?= e($row[$nameKey] ?? '-') ?></td><td><?= e((string) $row['loads_count']) ?></td><td><?= number_format((float) $row['miles']) ?></td><td><?= money($row['revenue']) ?></td></tr>
            <?php endforeach; ?>
            <?php if (!$rows): ?><tr><td colspan="4" class="empty">No data found.</td></tr><?php endif; ?>
        </tbody>
    </table>
</div>
