springload/responsive-table-column-switcher

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

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.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.