Table-Sorter Available Via NPM

This is just a quick post to say my <table-sorter> web component is now available via npm! My thanks go to Thomas Steiner who suggested I take my little CodePen demo and actually publish it. You can find it at NPM he…


This content originally appeared on Raymond Camden and was authored by Raymond Camden

This is just a quick post to say my <table-sorter> web component is now available via npm! My thanks go to Thomas Steiner who suggested I take my little CodePen demo and actually publish it. You can find it at NPM here, https://www.npmjs.com/package/@raymondcamden/table-sorter, and install it in your project like so:

npm install @raymondcamden/table-sorter

And holy crap - 79 downloads already? That's pretty cool. You can find the repo here, https://github.com/cfjedimaster/table-sorter/, where I've got a few issues (again, thanks to Thomas) for future updates.

As a reminder, this web component progressively enhances a table so that users can click to sort the table in different ways. You literally just wrap an existing table:

<!-- numeric is optional and lets the component know what columns to treat as numbers --><table-sorter numeric="4"><table>	<thead>		<tr>			<th>Name</th>			<th>Breed</th>			<th>Gender</th>			<th>Age</th>		</tr>	</thead>	<tbody>		<tr>			<td>Luna</td>			<td>Domestic Shorthair</td>			<td>Female</td>			<td>11</td>		</tr>		<!-- lots of rows -->		<tr>			<td>Apollo</td>			<td>Persian</td>			<td>Male</td>			<td>3</td>		</tr>		</tbody></table></table-sorter>

You can check out an online demo here: https://cfjedimaster.github.io/table-sorter/demo.html


This content originally appeared on Raymond Camden and was authored by Raymond Camden


Print Share Comment Cite Upload Translate Updates
APA

Raymond Camden | Sciencx (2024-06-10T18:00:00+00:00) Table-Sorter Available Via NPM. Retrieved from https://www.scien.cx/2024/06/10/table-sorter-available-via-npm/

MLA
" » Table-Sorter Available Via NPM." Raymond Camden | Sciencx - Monday June 10, 2024, https://www.scien.cx/2024/06/10/table-sorter-available-via-npm/
HARVARD
Raymond Camden | Sciencx Monday June 10, 2024 » Table-Sorter Available Via NPM., viewed ,<https://www.scien.cx/2024/06/10/table-sorter-available-via-npm/>
VANCOUVER
Raymond Camden | Sciencx - » Table-Sorter Available Via NPM. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/06/10/table-sorter-available-via-npm/
CHICAGO
" » Table-Sorter Available Via NPM." Raymond Camden | Sciencx - Accessed . https://www.scien.cx/2024/06/10/table-sorter-available-via-npm/
IEEE
" » Table-Sorter Available Via NPM." Raymond Camden | Sciencx [Online]. Available: https://www.scien.cx/2024/06/10/table-sorter-available-via-npm/. [Accessed: ]
rf:citation
» Table-Sorter Available Via NPM | Raymond Camden | Sciencx | https://www.scien.cx/2024/06/10/table-sorter-available-via-npm/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.