Name: responsive-table-column-switcher
Owner: Springload
Description: A simple, Javascript-driven way to render tables on small screens.
Created: 2014-10-12 23:36:48.0
Updated: 2016-07-07 10:39:29.0
Pushed: 2014-10-12 23:45:19.0
Homepage: null
Size: 120
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A simple, Javascript-driven way to render tables on small screens. Below a certain width, the table condenses into two columns and the user can choose which column to display by changing the value of a select element.
For now this is a proof-of-concept. It will probably bork with tables that use colspan, or don?t follow a very similiar structure to the ones in index.html.
Anyway, just load table-column-switcher.js into your document, and add these data- attributes to your table:
data-column-switch
Tells javascript to modify this table
data-column-switch-cols='2 3'
Tells javascript which columns to make switchable.
data-column-switch-default-col='3'
Tells javascript which column to show by default.