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
[email protected]
|
Director Human resources | United Kingdom Code: GB | Active |
A
Anne Richard
[email protected]
|
Seller Branding products | United States Code: US | Pending |
David Harrison
[email protected]
|
Unknown Unknown | United States Code: US | Active |
Finch Hoot
[email protected]
|
Designer IT department | Argentina Code: AR | Suspended |
B
Bob Dean
[email protected]
|
Executive director Marketing | Austria Code: AT | Active |
Ella Lauda
[email protected]
|
Co-founder All departments | United Kingdom Code: GB | Active |
L
Lori Hunter
[email protected]
|
Developer Mobile app | Estonia Code: EE | Active |
M
Mark Colbert
[email protected]
|
Executive director Human resources | Canada Code: CA | Active |
Costa Quinn
[email protected]
|
Co-founder All departments | France Code: FR | Pending |
R
Rachel Doe
[email protected]
|
Accountant Finance | United States Code: US | Active |
Linda Bates
[email protected]
|
Unknown Unknown | United Kingdom Code: UK | Suspended |
B
Brian Halligan
[email protected]
|
Director Accounting | France Code: FR | Active |
C
Chris Mathew
[email protected]
|
Developer Mobile app | Switzerland Code: CH | Pending |
Clarice Boone
[email protected]
|
Seller Branding products | United Kingdom Code: UK | Active |
L
Lewis Clarke
[email protected]
|
Co-founder IT department | Switzerland Code: CH | Pending |
Sam Kart
[email protected]
|
Designer Branding | Canada Code: CA | Pending |
J
Johnny Appleseed
[email protected]
|
Accountant Human resources | United States Code: US | Active |
P
Phileas Fogg
[email protected]
|
Designer Branding | Spain Code: ES | Suspended |
Mark Williams
[email protected]
|
Co-founder Branding | United Kingdom Code: GB | Active |
T
Timothy Silva
[email protected]
|
Developer Mobile app | Italy Code: IT | Pending |
G
Gary Bishop
[email protected]
|
Developer Mobile app | Latvia Code: LV | Active |
Y
Yorker Scogings
[email protected]
|
Seller Branding products | Norway Code: NO | Suspended |
F
Frank Phillips
[email protected]
|
Unknown Unknown | Norway Code: NO | Suspended |
E
Elizabeth Carter
[email protected]
|
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">[email protected]</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">[email protected]</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">[email protected]</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">[email protected]</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">[email protected]</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">[email protected]</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">[email protected]</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">[email protected]</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">[email protected]</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">[email protected]</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">[email protected]</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">[email protected]</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">[email protected]</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">[email protected]</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">[email protected]</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">[email protected]</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">[email protected]</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">[email protected]</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">[email protected]</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">[email protected]</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">[email protected]</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">[email protected]</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">[email protected]</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">[email protected]</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 |