
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600× Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
html-tabled
Advanced tools
Data-driven HTML tables with vanilla JavaScript
<table>
<thead>
<tr>
<th>First Name</td>
<th>Last Name</td>
<th>Age</td>
</tr>
</thead>
<tbody>
<tr>
<td>John</td>
<td>Smith</td>
<td>29</td>
</tr>
<tr>
<td>Jane</td>
<td>Doe</td>
<td>26</td>
</tr>
</tbody>
</table>
<script>
tabled.create(document.getElementByTag("table")[0]);
</script>
$ npm install html-tabled
var tabled = require('html-tabled');
tabled.create(document.getElementByTag("table")[0]);
While it's very easy to specify a body for your table, you may want to dynamically populate it using JavaScript. For this, you will need to specify a schema.
At minimum, you will need to provide a <thead></thead>
tag in your table.
<table>
<thead>
<th>First Name</th> <!-- Column index 0 -->
<th>Last Name</th> <!-- Column index 1 -->
<th>Age</th> <!-- Column index 2 -->
</thead>
</table>
tabled
will use these tags to create an initial schema for the table. By
default, it will read these tags and convert them to camel case when creating
your schema. Assuming your table looks like the latter, your schema now looks
like this:
table.headers = [ "firstName", "lastName", "age" ]
The table can now be populated.
var tabled = require('html-tabled');
var table = tabled.create(document.getElementByTag("table")[0], {
data: [
{ firstName: "John", lastName: "Doe", age: "28" }
]
});
You can also update the table and it will adjust automatically.
table.data = [
{ firstName: "Jane", lastName: "Doe", age: "26" }
]
tabled
You can toggle between pages by calling page
and specifying a page number.
table.page(1);
You can also filter by a string by calling filter
. Filtering is
case-insensitive.
table.filter("john");
Feel free to open a pull-request and contribute to the development of
tabled
. Currently, these items are on the roadmap.
The test suite is on Node.js and uses PhantomJS with Mocha.
$ npm install -g
$ npm test
MIT
FAQs
Data-driven HTML tables with vanilla JavaScript
The npm package html-tabled receives a total of 0 weekly downloads. As such, html-tabled popularity was classified as not popular.
We found that html-tabled demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.