![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
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.js
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.js
. 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 tabledjs receives a total of 0 weekly downloads. As such, tabledjs popularity was classified as not popular.
We found that tabledjs 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.