2.0.17 • Published 4 months ago
rehype-responsive-tables v2.0.17
Install
This package is not pure ESM, you can require
it.
npm i rehype-responsive-tables
Quick Take
import { strict as assert } from "assert";
import { rehype } from "rehype";
import rehypeFormat from "rehype-format";
import rehypeResponsiveTables from "rehype-responsive-tables";
let input = `
<table>
<tbody>
<tr>
<td>a</td>
<td>b</td>
<td>c</td>
</tr>
</tbody>
</table>
`;
let intended = `
<table class="rrt-table">
<tbody>
<tr class="rrt-new-tr">
<td class="rrt-del-td"></td>
<td colspan="2"><span class="rrt-new-tr__span-top">a</span></td>
</tr>
<tr>
<td class="rrt-del-td">a</td>
<td>b</td>
<td>c</td>
</tr>
</tbody>
</table>
`;
assert.equal(
rehype()
.data("settings", { fragment: true })
.use(rehypeResponsiveTables, {
tableClassName: "rrt-table",
})
.use(rehypeFormat)
.processSync(input)
.toString(),
intended,
);
Documentation
Please visit codsen.com for a full description of the API. Also, try the GUI playground.
Contributing
To report bugs or request features or assistance, raise an issue on GitHub.
Licence
MIT License.
Copyright © 2010-2025 Roy Revelt and other contributors.
2.0.17
4 months ago
2.0.14
1 year ago
2.0.13
2 years ago
2.0.12
2 years ago
2.0.11
2 years ago
2.0.9
2 years ago
2.0.10
2 years ago
2.0.5
2 years ago
2.0.4
2 years ago
2.0.7
2 years ago
2.0.6
2 years ago
2.0.8
2 years ago
1.4.5
3 years ago
1.4.4
3 years ago
1.4.3
3 years ago
1.4.2
3 years ago
1.4.1
3 years ago
1.4.0
3 years ago
1.3.0
3 years ago
2.0.3
3 years ago
2.0.2
3 years ago
2.0.1
3 years ago
2.0.0
3 years ago
1.2.0
3 years ago
1.1.0
3 years ago
1.0.2
3 years ago
1.0.1
3 years ago