<thead>
<th style="width:30px;text-align:center;">
    <input type="checkbox" name="sub_all" id="sub_all" value=""/>
</th>
<?php foreach ($fields as $field_name => $field_display): ?>
    <th tabindex="0" rowspan="1" colspan="1">
        <?php echo $field_display; ?>
    </th>
<?php endforeach; ?>
</thead>