autocols
v1.0.5
Published
Automatically hide table columns when there is not enough space
Downloads
3
Maintainers
Readme
Autocols
Automatically hide table columns when there is not enough space.
Installation
npm i autocols
Usage
Import Autocols:
import "autocols";
Or add it via script tag:
<script src="node_modules/autocols/autocols.js"></script>
Add "autocols" class to table elements:
<table class="autocols">...</table>
Create an instance to initialize Autocols:
const autocols = new window.Autocols();
To force keeping columns add "data-keepindexes" attribute with comma separated indexes:
<table class="autocols" data-keepindexes="2,3">...</table>
Autocols is triggered when the document view (window) is resized. Use the "run" method if you need to trigger it manually:
autocols.run();