Name: table
Owner: Legitcode
Description: the simplest, most hands-off table helper
Created: 2015-09-04 21:57:14.0
Updated: 2017-07-04 11:50:44.0
Pushed: 2015-10-07 20:21:29.0
Homepage: http://legitcode.github.io/table/
Size: 1029
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
npm install react-legit-table
I know what you're thinking… Yet another one of these things, right? I was using Facebook's Fixed Data Table until I realized how big of a library it is. All I needed was a simple html table. It's as simple as it can be, and works great with bootstrap:
rt Table from 'react-legit-table'
rows = [
id: 1,
name: 'Zach',
job: 'coding'
id: 2,
name: 'Jed',
job: 'Being a boss'
er(){
turn (
<Table className="table table-bordered" rows={rows} />
The component expects simple, regular ol' javascript objects inside of an array.
modify
accepts an object with keys equal to those in your rows object and the values are callbacks that will be called on rendering a row.
Optionally, use modifyAll
to change every item.
Example:
fyId({hidden, value, key, row}){
turn <a href={value}>{value}</a>
er() {
turn (
<Table
rows={rows}
modify={{
id: this.modifyId
}}/>
tionally modifyAll rows:
le
={rows}
fyAll={this.modify}
capitalize
Optionally, turn off capitalization of header row. True by default.
le rows={rows} capitalize={false} />
I want to keep this simple and it has been perfect for my use case so far, but I'd love to hear suggestions.