I've found several solutions for a fixed header, but none of them will fix my problem.
I have a table, styled with jQuery mobile (Responsive table). This table is dynamically filled with a .append
. The columns don't have a fixed width, they vary.
Is there a way, to fix the header of the table, so that I am able to scroll through the table body with the header always showing at the top, but without the use of multiple tables.
Summary:
I would like to have a single table with a fixed header.
I'm amazed that there is no standard for this, as I assume that this is something most webdevs can use. Please, correct me if I'm wrong.
Thank you in advance!
Edit:
Example:
<table id="my_id" data-role="table" class="ui-body-d ui-shadow table-stripe
ui-responsive">
<thead id="must_be_static">
<tr>
<th>This guy should be static</th>
<th>This guy should be static</th>
<th>This guy should be static</th>
<th>This guy should be static</th>
<th>This guy should be static</th>
</tr>
</thead>
<tbody id="id_for_content">
<tr>
<td>Dynamic content</td>
<td>Dynamic content</td>
<td>Dynamic content</td>
<td>Dynamic content</td>
<td>Dynamic content</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>Foot</td>
<td>Foot</td>
<td>Foot</td>
<td>Foot</td>
<td>Foot</td>
</tr>
</tfoot>
</table>