table creator filerext - Free Download Dynamic Table Creator In jQuery & Vanilla JS - TableFilerExt

Free Download Dynamic Table Creator In jQuery & Vanilla JS – TableFilerExt

Posted on

This time I will share jQuery Plugin and tutorial about Dynamic Table Creator In jQuery & Vanilla JS – TableFilerExt, hope it will help you in programming stack.

table creator filerext - Free Download Dynamic Table Creator In jQuery & Vanilla JS - TableFilerExt
File Size: 6.16 KB
Views Total: 626
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

TableFilerExt is a lightweight JavaScript plugin to dynamically insert headers (th) and cells (td) into an HTML table using JavaScript syntax.

Supports colspan and empty table cells.

How to use it:

1. Insert the TableFilerExt plugin’s JavaScript into the HTML file.

1 <!-- As a Vanilla JS Plugin -->
2 <script src="tableFillerExt.min.js"></script>
3  
4 <!-- As a jQuery Plugin -->
5 <script src="jquery.min.js"></script>
6 <script src="jquery.tableFillerExt.min.js"></script>

2. Create an empty table element on the page.

1 <table id="table"></table>

3. Add headers and tabular data to the HTML table.

1 // Vanilla JavaScript
2 let table = document.getElementById("table");
3 table.addThs("H1",2,"H2","H3")
4 .addTds("A1",2,"F1","F2")
5  
6 // jQuery
7 let table = $("#table");
8 table.addThs("H1",2,"H2","H3")
9 .addTds("A1",2,"F1","F2")

4. That’s it. The empty table will be populated with the data you provide as follows:

01 <table id="table">
02   <tbody>
03     <tr>
04       <th>H1</th>
05       <th colspan="2">H2</th>
06       <th>H3</th>
07     </tr>
08     <tr>
09       <td>A1</td>
10       <td></td>
11       <td></td>
12       <td>F1</td>
13       <td>F2</td>
14     </tr>
15   </tbody>
16 </table>

Changelog:

2020-01-02

  • added adding function after choosen tr

This awesome jQuery plugin is developed by Saier00. For more Advanced Usages, please check the demo page or visit the official website.

source : jquery.net