pure, small and estetics data table. available in vanilla, vue, react and svelte.
Demo : https://codepen.io/alanshalih/pen/mdXNPNP
npm i dr.table
<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>
<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>
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>
)
}
<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>
rewrite from JSTable https://github.com/jstable/JSTable