Sticky Header
Make a table thead sticky to the top of a page, card or any other content.
How to use
Copy-paste the stylesheet <link>
into your <head>
to load the CSS.
<link rel="stylesheet" href="./assets/vendor/hs-table-sticky-header/src/hs.table-sticky-header.css">
Copy-paste the init function under JS Plugins Init., before the closing </body>
tag, to enable it.
<script src="./assets/vendor/hs-table-sticky-header/src/hs.table-sticky-header.js"></script>
<script>
$(document).on('ready', function () {
// INITIALIZATION OF STICKY HEADER
// =======================================================
new HSTableStickyHeader('.js-sticky-header', {
offsetTop: "60px"
}).init();
});
</script>
Example
Name | Position | Country | Status |
---|---|---|---|
Amanda Harvey
amanda@example.com
|
Director Human resources | United Kingdom Code: GB | Active |
A
Anne Richard
anne@example.com
|
Seller Branding products | United States Code: US | Pending |
David Harrison
david@example.com
|
Unknown Unknown | United States Code: US | Active |
Finch Hoot
finch@example.com
|
Designer IT department | Argentina Code: AR | Suspended |
B
Bob Dean
bob@example.com
|
Executive director Marketing | Austria Code: AT | Active |
Ella Lauda
ella@example.com
|
Co-founder All departments | United Kingdom Code: GB | Active |
L
Lori Hunter
hunter@example.com
|
Developer Mobile app | Estonia Code: EE | Active |
M
Mark Colbert
mark@example.com
|
Executive director Human resources | Canada Code: CA | Active |
Costa Quinn
costa@example.com
|
Co-founder All departments | France Code: FR | Pending |
R
Rachel Doe
rachel@example.com
|
Accountant Finance | United States Code: US | Active |
Linda Bates
linda@example.com
|
Unknown Unknown | United Kingdom Code: UK | Suspended |
B
Brian Halligan
brian@example.com
|
Director Accounting | France Code: FR | Active |
C
Chris Mathew
chris@example.com
|
Developer Mobile app | Switzerland Code: CH | Pending |
Clarice Boone
clarice@example.com
|
Seller Branding products | United Kingdom Code: UK | Active |
L
Lewis Clarke
lewis@example.com
|
Co-founder IT department | Switzerland Code: CH | Pending |
Sam Kart
sam@example.com
|
Designer Branding | Canada Code: CA | Pending |
J
Johnny Appleseed
johnny@example.com
|
Accountant Human resources | United States Code: US | Active |
P
Phileas Fogg
phileas@example.com
|
Designer Branding | Spain Code: ES | Suspended |
Mark Williams
mark@example.com
|
Co-founder Branding | United Kingdom Code: GB | Active |
T
Timothy Silva
timothy@example.com
|
Developer Mobile app | Italy Code: IT | Pending |
G
Gary Bishop
gary@example.com
|
Developer Mobile app | Latvia Code: LV | Active |
Y
Yorker Scogings
yorker@example.com
|
Seller Branding products | Norway Code: NO | Suspended |
F
Frank Phillips
frank@example.com
|
Unknown Unknown | Norway Code: NO | Suspended |
E
Elizabeth Carter
eliz@example.com
|
Unknown Unknown | United States Code: UK | Pending |
<div class="js-sticky-header">
<!-- Table -->
<div class="table-responsive">
<table class="table table-lg table-borderless table-thead-bordered table-nowrap table-align-middle">
<thead class="thead-light">
<tr>
<th scope="col">Name</th>
<th scope="col">Position</th>
<th scope="col">Country</th>
<th scope="col">Status</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a class="d-flex align-items-center" href="../user-profile.html">
<div class="avatar avatar-circle">
<img class="avatar-img" src="../assets/img/160x160/img10.jpg" alt="Image Description">
</div>
<div class="flex-grow-1 ms-3">
<span class="d-block h5 text-inherit mb-0">Amanda Harvey <i class="tio-verified text-primary" data-bs-toggle="tooltip" data-bs-placement="top" title="Top endorsed"></i></span>
<span class="d-block fs-6 text-body">amanda@example.com</span>
</div>
</a>
</td>
<td>
<span class="d-block h5 mb-0">Director</span>
<span class="d-block fs-6">Human resources</span>
</td>
<td>United Kingdom <span class="visually-hidden">Code: GB</span></td>
<td>
<span class="legend-indicator bg-success"></span>Active
</td>
</tr>
<tr>
<td>
<a class="d-flex align-items-center" href="../user-profile.html">
<div class="avatar avatar-soft-primary avatar-circle">
<span class="avatar-initials">A</span>
</div>
<div class="flex-grow-1 ms-3">
<span class="d-block h5 text-inherit mb-0">Anne Richard</span>
<span class="d-block fs-6 text-body">anne@example.com</span>
</div>
</a>
</td>
<td>
<span class="d-block h5 mb-0">Seller</span>
<span class="d-block fs-6">Branding products</span>
</td>
<td>United States <span class="visually-hidden">Code: US</span></td>
<td>
<span class="legend-indicator bg-warning"></span>Pending
</td>
</tr>
<tr>
<td>
<a class="d-flex align-items-center" href="../user-profile.html">
<div class="avatar avatar-circle">
<img class="avatar-img" src="../assets/img/160x160/img3.jpg" alt="Image Description">
</div>
<div class="flex-grow-1 ms-3">
<span class="d-block h5 text-inherit mb-0">David Harrison</span>
<span class="d-block fs-6 text-body">david@example.com</span>
</div>
</a>
</td>
<td>
<span class="d-block h5 mb-0">Unknown</span>
<span class="d-block fs-6">Unknown</span>
</td>
<td>United States <span class="visually-hidden">Code: US</span></td>
<td>
<span class="legend-indicator bg-success"></span>Active
</td>
</tr>
<tr>
<td>
<a class="d-flex align-items-center" href="../user-profile.html">
<div class="avatar avatar-circle">
<img class="avatar-img" src="../assets/img/160x160/img5.jpg" alt="Image Description">
</div>
<div class="flex-grow-1 ms-3">
<span class="d-block h5 text-inherit mb-0">Finch Hoot</span>
<span class="d-block fs-6 text-body">finch@example.com</span>
</div>
</a>
</td>
<td>
<span class="d-block h5 mb-0">Designer</span>
<span class="d-block fs-6">IT department</span>
</td>
<td>Argentina <span class="visually-hidden">Code: AR</span></td>
<td>
<span class="legend-indicator bg-danger"></span>Suspended
</td>
</tr>
<tr>
<td>
<a class="d-flex align-items-center" href="../user-profile.html">
<div class="avatar avatar-soft-dark avatar-circle">
<span class="avatar-initials">B</span>
</div>
<div class="flex-grow-1 ms-3">
<span class="d-block h5 text-inherit mb-0">Bob Dean</span>
<span class="d-block fs-6 text-body">bob@example.com</span>
</div>
</a>
</td>
<td>
<span class="d-block h5 mb-0">Executive director</span>
<span class="d-block fs-6">Marketing</span>
</td>
<td>Austria <span class="visually-hidden">Code: AT</span></td>
<td>
<span class="legend-indicator bg-success"></span>Active
</td>
</tr>
<tr>
<td>
<a class="d-flex align-items-center" href="../user-profile.html">
<div class="avatar avatar-circle">
<img class="avatar-img" src="../assets/img/160x160/img9.jpg" alt="Image Description">
</div>
<div class="flex-grow-1 ms-3">
<span class="d-block h5 text-inherit mb-0">Ella Lauda <i class="tio-verified text-primary" data-bs-toggle="tooltip" data-bs-placement="top" title="Top endorsed"></i></span>
<span class="d-block fs-6 text-body">ella@example.com</span>
</div>
</a>
</td>
<td>
<span class="d-block h5 mb-0">Co-founder</span>
<span class="d-block fs-6">All departments</span>
</td>
<td>United Kingdom <span class="visually-hidden">Code: GB</span></td>
<td>
<span class="legend-indicator bg-success"></span>Active
</td>
</tr>
<tr>
<td>
<a class="d-flex align-items-center" href="../user-profile.html">
<div class="avatar avatar-soft-info avatar-circle">
<span class="avatar-initials">L</span>
</div>
<div class="flex-grow-1 ms-3">
<span class="d-block h5 text-inherit mb-0">Lori Hunter</span>
<span class="d-block fs-6 text-body">hunter@example.com</span>
</div>
</a>
</td>
<td>
<span class="d-block h5 mb-0">Developer</span>
<span class="d-block fs-6">Mobile app</span>
</td>
<td>Estonia <span class="visually-hidden">Code: EE</span></td>
<td>
<span class="legend-indicator bg-success"></span>Active
</td>
</tr>
<tr>
<td>
<a class="d-flex align-items-center" href="../user-profile.html">
<div class="avatar avatar-soft-primary avatar-circle">
<span class="avatar-initials">M</span>
</div>
<div class="flex-grow-1 ms-3">
<span class="d-block h5 text-inherit mb-0">Mark Colbert</span>
<span class="d-block fs-6 text-body">mark@example.com</span>
</div>
</a>
</td>
<td>
<span class="d-block h5 mb-0">Executive director</span>
<span class="d-block fs-6">Human resources</span>
</td>
<td>Canada <span class="visually-hidden">Code: CA</span></td>
<td>
<span class="legend-indicator bg-success"></span>Active
</td>
</tr>
<tr>
<td>
<a class="d-flex align-items-center" href="../user-profile.html">
<div class="avatar avatar-circle">
<img class="avatar-img" src="../assets/img/160x160/img6.jpg" alt="Image Description">
</div>
<div class="flex-grow-1 ms-3">
<span class="d-block h5 text-inherit mb-0">Costa Quinn</span>
<span class="d-block fs-6 text-body">costa@example.com</span>
</div>
</a>
</td>
<td>
<span class="d-block h5 mb-0">Co-founder</span>
<span class="d-block fs-6">All departments</span>
</td>
<td>France <span class="visually-hidden">Code: FR</span></td>
<td>
<span class="legend-indicator bg-warning"></span>Pending
</td>
</tr>
<tr>
<td>
<a class="d-flex align-items-center" href="../user-profile.html">
<div class="avatar avatar-soft-danger avatar-circle">
<span class="avatar-initials">R</span>
</div>
<div class="flex-grow-1 ms-3">
<span class="d-block h5 text-inherit mb-0">Rachel Doe <i class="tio-verified text-primary" data-bs-toggle="tooltip" data-bs-placement="top" title="Top endorsed"></i></span>
<span class="d-block fs-6 text-body">rachel@example.com</span>
</div>
</a>
</td>
<td>
<span class="d-block h5 mb-0">Accountant</span>
<span class="d-block fs-6">Finance</span>
</td>
<td>United States <span class="visually-hidden">Code: US</span></td>
<td>
<span class="legend-indicator bg-success"></span>Active
</td>
</tr>
<tr>
<td>
<a class="d-flex align-items-center" href="../user-profile.html">
<div class="avatar avatar-circle">
<img class="avatar-img" src="../assets/img/160x160/img8.jpg" alt="Image Description">
</div>
<div class="flex-grow-1 ms-3">
<span class="d-block h5 text-inherit mb-0">Linda Bates</span>
<span class="d-block fs-6 text-body">linda@example.com</span>
</div>
</a>
</td>
<td>
<span class="d-block h5 mb-0">Unknown</span>
<span class="d-block fs-6">Unknown</span>
</td>
<td>United Kingdom <span class="visually-hidden">Code: UK</span></td>
<td>
<span class="legend-indicator bg-danger"></span>Suspended
</td>
</tr>
<tr>
<td>
<a class="d-flex align-items-center" href="../user-profile.html">
<div class="avatar avatar-soft-info avatar-circle">
<span class="avatar-initials">B</span>
</div>
<div class="flex-grow-1 ms-3">
<span class="d-block h5 text-inherit mb-0">Brian Halligan</span>
<span class="d-block fs-6 text-body">brian@example.com</span>
</div>
</a>
</td>
<td>
<span class="d-block h5 mb-0">Director</span>
<span class="d-block fs-6">Accounting</span>
</td>
<td>France <span class="visually-hidden">Code: FR</span></td>
<td>
<span class="legend-indicator bg-success"></span>Active
</td>
</tr>
<tr>
<td>
<a class="d-flex align-items-center" href="../user-profile.html">
<div class="avatar avatar-soft-dark avatar-circle">
<span class="avatar-initials">C</span>
</div>
<div class="flex-grow-1 ms-3">
<span class="d-block h5 text-inherit mb-0">Chris Mathew</span>
<span class="d-block fs-6 text-body">chris@example.com</span>
</div>
</a>
</td>
<td>
<span class="d-block h5 mb-0">Developer</span>
<span class="d-block fs-6">Mobile app</span>
</td>
<td>Switzerland <span class="visually-hidden">Code: CH</span></td>
<td>
<span class="legend-indicator bg-warning"></span>Pending
</td>
</tr>
<tr>
<td>
<a class="d-flex align-items-center" href="../user-profile.html">
<div class="avatar avatar-circle">
<img class="avatar-img" src="../assets/img/160x160/img7.jpg" alt="Image Description">
</div>
<div class="flex-grow-1 ms-3">
<span class="d-block h5 text-inherit mb-0">Clarice Boone <i class="tio-verified text-primary" data-bs-toggle="tooltip" data-bs-placement="top" title="Top endorsed"></i></span>
<span class="d-block fs-6 text-body">clarice@example.com</span>
</div>
</a>
</td>
<td>
<span class="d-block h5 mb-0">Seller</span>
<span class="d-block fs-6">Branding products</span>
</td>
<td>United Kingdom <span class="visually-hidden">Code: UK</span></td>
<td>
<span class="legend-indicator bg-success"></span>Active
</td>
</tr>
<tr>
<td>
<a class="d-flex align-items-center" href="../user-profile.html">
<div class="avatar avatar-soft-dark avatar-circle">
<span class="avatar-initials">L</span>
</div>
<div class="flex-grow-1 ms-3">
<span class="d-block h5 text-inherit mb-0">Lewis Clarke</span>
<span class="d-block fs-6 text-body">lewis@example.com</span>
</div>
</a>
</td>
<td>
<span class="d-block h5 mb-0">Co-founder</span>
<span class="d-block fs-6">IT department</span>
</td>
<td>Switzerland <span class="visually-hidden">Code: CH</span></td>
<td>
<span class="legend-indicator bg-warning"></span>Pending
</td>
</tr>
<tr>
<td>
<a class="d-flex align-items-center" href="../user-profile.html">
<div class="avatar avatar-circle">
<img class="avatar-img" src="../assets/img/160x160/img4.jpg" alt="Image Description">
</div>
<div class="flex-grow-1 ms-3">
<span class="d-block h5 text-inherit mb-0">Sam Kart</span>
<span class="d-block fs-6 text-body">sam@example.com</span>
</div>
</a>
</td>
<td>
<span class="d-block h5 mb-0">Designer</span>
<span class="d-block fs-6">Branding</span>
</td>
<td>Canada <span class="visually-hidden">Code: CA</span></td>
<td>
<span class="legend-indicator bg-warning"></span>Pending
</td>
</tr>
<tr>
<td>
<a class="d-flex align-items-center" href="../user-profile.html">
<div class="avatar avatar-soft-danger avatar-circle">
<span class="avatar-initials">J</span>
</div>
<div class="flex-grow-1 ms-3">
<span class="d-block h5 text-inherit mb-0">Johnny Appleseed</span>
<span class="d-block fs-6 text-body">johnny@example.com</span>
</div>
</a>
</td>
<td>
<span class="d-block h5 mb-0">Accountant</span>
<span class="d-block fs-6">Human resources</span>
</td>
<td>United States <span class="visually-hidden">Code: US</span></td>
<td>
<span class="legend-indicator bg-success"></span>Active
</td>
</tr>
<tr>
<td>
<a class="d-flex align-items-center" href="../user-profile.html">
<div class="avatar avatar-soft-danger avatar-circle">
<span class="avatar-initials">P</span>
</div>
<div class="flex-grow-1 ms-3">
<span class="d-block h5 text-inherit mb-0">Phileas Fogg</span>
<span class="d-block fs-6 text-body">phileas@example.com</span>
</div>
</a>
</td>
<td>
<span class="d-block h5 mb-0">Designer</span>
<span class="d-block fs-6">Branding</span>
</td>
<td>Spain <span class="visually-hidden">Code: ES</span></td>
<td>
<span class="legend-indicator bg-danger"></span>Suspended
</td>
</tr>
<tr>
<td>
<a class="d-flex align-items-center" href="../user-profile.html">
<div class="avatar avatar-circle">
<img class="avatar-img" src="../assets/img/160x160/img6.jpg" alt="Image Description">
</div>
<div class="flex-grow-1 ms-3">
<span class="d-block h5 text-inherit mb-0">Mark Williams <i class="tio-verified text-primary" data-bs-toggle="tooltip" data-bs-placement="top" title="Top endorsed"></i></span>
<span class="d-block fs-6 text-body">mark@example.com</span>
</div>
</a>
</td>
<td>
<span class="d-block h5 mb-0">Co-founder</span>
<span class="d-block fs-6">Branding</span>
</td>
<td>United Kingdom <span class="visually-hidden">Code: GB</span></td>
<td>
<span class="legend-indicator bg-success"></span>Active
</td>
</tr>
<tr>
<td>
<a class="d-flex align-items-center" href="../user-profile.html">
<div class="avatar avatar-soft-dark avatar-circle">
<span class="avatar-initials">T</span>
</div>
<div class="flex-grow-1 ms-3">
<span class="d-block h5 text-inherit mb-0">Timothy Silva</span>
<span class="d-block fs-6 text-body">timothy@example.com</span>
</div>
</a>
</td>
<td>
<span class="d-block h5 mb-0">Developer</span>
<span class="d-block fs-6">Mobile app</span>
</td>
<td>Italy <span class="visually-hidden">Code: IT</span></td>
<td>
<span class="legend-indicator bg-warning"></span>Pending
</td>
</tr>
<tr>
<td>
<a class="d-flex align-items-center" href="../user-profile.html">
<div class="avatar avatar-soft-dark avatar-circle">
<span class="avatar-initials">G</span>
</div>
<div class="flex-grow-1 ms-3">
<span class="d-block h5 text-inherit mb-0">Gary Bishop <i class="tio-verified text-primary" data-bs-toggle="tooltip" data-bs-placement="top" title="Top endorsed"></i></span>
<span class="d-block fs-6 text-body">gary@example.com</span>
</div>
</a>
</td>
<td>
<span class="d-block h5 mb-0">Developer</span>
<span class="d-block fs-6">Mobile app</span>
</td>
<td>Latvia <span class="visually-hidden">Code: LV</span></td>
<td>
<span class="legend-indicator bg-success"></span>Active
</td>
</tr>
<tr>
<td>
<a class="d-flex align-items-center" href="../user-profile.html">
<div class="avatar avatar-soft-dark avatar-circle">
<span class="avatar-initials">Y</span>
</div>
<div class="flex-grow-1 ms-3">
<span class="d-block h5 text-inherit mb-0">Yorker Scogings</span>
<span class="d-block fs-6 text-body">yorker@example.com</span>
</div>
</a>
</td>
<td>
<span class="d-block h5 mb-0">Seller</span>
<span class="d-block fs-6">Branding products</span>
</td>
<td>Norway <span class="visually-hidden">Code: NO</span></td>
<td>
<span class="legend-indicator bg-danger"></span>Suspended
</td>
</tr>
<tr>
<td>
<a class="d-flex align-items-center" href="../user-profile.html">
<div class="avatar avatar-soft-info avatar-circle">
<span class="avatar-initials">F</span>
</div>
<div class="flex-grow-1 ms-3">
<span class="d-block h5 text-inherit mb-0">Frank Phillips</span>
<span class="d-block fs-6 text-body">frank@example.com</span>
</div>
</a>
</td>
<td>
<span class="d-block h5 mb-0">Unknown</span>
<span class="d-block fs-6">Unknown</span>
</td>
<td>Norway <span class="visually-hidden">Code: NO</span></td>
<td>
<span class="legend-indicator bg-danger"></span>Suspended
</td>
</tr>
<tr>
<td>
<a class="d-flex align-items-center" href="../user-profile.html">
<div class="avatar avatar-soft-primary avatar-circle">
<span class="avatar-initials">E</span>
</div>
<div class="flex-grow-1 ms-3">
<span class="d-block h5 text-inherit mb-0">Elizabeth Carter</span>
<span class="d-block fs-6 text-body">eliz@example.com</span>
</div>
</a>
</td>
<td>
<span class="d-block h5 mb-0">Unknown</span>
<span class="d-block fs-6">Unknown</span>
</td>
<td>United States <span class="visually-hidden">Code: UK</span></td>
<td>
<span class="legend-indicator bg-warning"></span>Pending
</td>
</tr>
</tbody>
</table>
</div>
<!-- End Table -->
</div>
Methods
Parameters | Description | Default value |
---|---|---|
|
Add custom offset from top in px | 0 |