Skip to content

Instantly share code, notes, and snippets.

@kevee
Created March 30, 2020 17:46
Show Gist options
  • Save kevee/c3d94fff6b1c077116f2110591532b67 to your computer and use it in GitHub Desktop.
Save kevee/c3d94fff6b1c077116f2110591532b67 to your computer and use it in GitHub Desktop.
import React, { useEffect } from 'react'
import Tablesaw from 'tablesaw'
import Layout from '../components/layout'
import 'tablesaw/dist/tablesaw.css'
export default () => {
useEffect(() => {
Tablesaw.init()
}, [])
return (
<Layout>
<table data-tablesaw-sortable>
<thead>
<tr>
<th data-tablesaw-sortable-col data-tablesaw-sortable-default-col>
Rank
</th>
<th data-tablesaw-sortable-col>Movie Title</th>
<th data-tablesaw-sortable-col data-tablesaw-sortable-numeric>
Year
</th>
<th data-tablesaw-sortable-col data-tablesaw-sortable-numeric>
<abbr title="Rotten Tomato Rating">Rating</abbr>
</th>
<th>Reviews</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>2</td>
<td>test</td>
<td>um</td>
<td>2</td>
</tr>
</tbody>
</table>
</Layout>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment