dr.table
781
| Install | |
|---|---|
npm install dr.table |
|
| Latest Version: | 1.0.29 |
| Vue: | 3 |
| Last Updated: | Jun 24, 2022 |
| Links: | npm |
Maintainer: maulanashalihin
dr.table
pure, small and estetics data table. available in vanilla, vue, react and svelte.
Demo : https://codepen.io/alanshalih/pen/mdXNPNP
Installation
npm i dr.table
Usage
1. Vanilla JS
<table id="my-table">
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th>Phone</th>
</tr>
</thead>
<tbody>
<tr>
<td>Maulana Shalihin</td>
<td>maulanashalihin@gmail.com</td>
<td>6281351000000</td>
</tr>
</tbody>
</table>
<script>
import DRTable from "dr.table"
new DRTable("#my-table")
</script>
Vue.js 3
<script setup>
import DRTable from 'dr.table/vue'
</script>
<template>
<DRTable>
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th>Phone</th>
</tr>
</thead>
<tbody>
<tr>
<td>Maulana Shalihin</td>
<td>maulanashalihin@gmail.com</td>
<td>6281351000000</td>
</tr>
</tbody>
</DRTable>
</template>
React
import Table from "dr.table"
import "dr.table/style.css"
import { useEffect } from "react";
export default function DRTable(props) {
useEffect(() => {
//Runs only on the first render
const mytable = new Table("#dr-table")
}, []);
return (
<div>
<table className="invisible" id="dr-table">
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th>Phone</th>
</tr>
</thead>
<tbody>
<tr>
<td>Maulana Shalihin</td>
<td>maulanashalihin@gmail.com</td>
<td>6281351000000</td>
</tr>
</tbody>
</table>
</div>
)
}
Svelte
<script>
import DRtable from "dr.table/svelte"
</script>
<DRtable>
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th>Phone</th>
</tr>
</thead>
<tbody>
<tr>
<td>Maulana Shalihin</td>
<td>maulanashalihin@gmail.com</td>
<td>6281351000000</td>
</tr>
</tbody>
</DRtable>
Credit
rewrite from JSTable https://github.com/jstable/JSTable
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 1.0.29 | ^3.2.25 | ||
| 1.0.28 | ^3.2.25 | ||
| 1.0.27 | ^3.2.25 | ||
| 1.0.26 | ^3.2.25 | ||
| 1.0.24 | ^3.2.25 | ||
| 1.0.23 | ^3.2.25 | ||
| 1.0.22 | ^3.2.25 | ||
| 1.0.21 | ^3.2.25 | ||
| 1.0.20 | ^3.2.25 | ||
| 1.0.19 | ^3.2.25 | ||
| 1.0.18 | ^3.2.25 | ||
| 1.0.17 | ^3.2.25 | ||
| 1.0.16 | ^3.2.25 | ||
| 1.0.15 | ^3.2.25 | ||
| 1.0.14 | ^3.2.25 | ||
| 1.0.13 | ^3.2.25 | ||
| 1.0.12 | ^3.2.25 | ||
| 1.0.11 | ^3.2.25 | ||
| 1.0.10 | ^3.2.25 | ||
| 1.0.9 | ^3.2.25 | ||
| 1.0.8 | ^3.2.25 | ||
| 1.0.7 | ^3.2.25 | ||
| 1.0.6 | ^3.2.25 | ||
| 1.0.5 | ^3.2.25 | ||
| 1.0.4 | ^3.2.25 | ||
| 1.0.3 | ^3.2.25 | ||
| 1.0.1 | MIT | ||
| 1.0.0 | MIT | ||
| 0.0.1 | ^3.2.25 |