autocols

1.0.5 • Public • Published

Autocols

Automatically hide table columns when there is not enough space.

npm version

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();

Package Sidebar

Install

npm i autocols

Weekly Downloads

1

Version

1.0.5

License

MIT

Unpacked Size

6.08 kB

Total Files

5

Last publish

Collaborators

  • thiagomdo1