js-sticky-table-headers
v1.0.0-alpha.8
Published
Sticky table headers (JS way). Just to support overflow layout.
Downloads
24
Readme
Sticky table headers (JS way). Just to support overflow layout.
Installation
$ npm i -D js-sticky-table-headers
Usage
VanillaJs
import stickyHeader from 'js-sticky-table-headers';
document.addEventListener('DOMContentLoaded', () => {
stickyHeader(document.querySelector('.table-wrapper'));
});
Svelte
<script>
import stickyHeader from 'js-sticky-table-headers';
let pageTitle = '';
onMount(() => {
stickyHeader(document.querySelector('.table-wrapper'));
});
</script>
React
import { useEffect } from 'react';
// ...
useEffect(() => {
stickyHeader(document.querySelector('.table-wrapper'));
}, []);
Vue 3
<script setup>
import { onMounted } from 'vue';
onMounted(() => {
stickyHeader(document.querySelector('.table-wrapper'));
});
</script>
SolidJS
import { createSignal, onMount } from 'solid-js';
// ...
onMount(() => {
setPageTitle(document.title);
});