DynamicTable - turn your HTML table elements into interactive tables
September 12th, 2012Do you also like the moments when you browse through the code you wrote years ago? I've just had one of these and discovered a tiny JavaScript library which I wrote about five years ago that turns your HTML table elements into interactive tables with sorting, filtering and paging and couple of visual effects as well. A JavaScript library that runs on Firefox 2, IE 6 and other ancient browsers without any external help. No jQuery, Prototype or any other help. I decided to share my excitment with you and so I translated documentation and demo from Czech to English and here it is.
The code can be found on Github and is licensed under the MIT license.
AFN | Afghanistan Afghanis | 75.3966389450 | 0.0132631907 |
ALL | Albania Leke | 149.7174910491 | 0.0066792463 |
ALL | Albania Leke | 120.1585000394 | 0.0083223409 |
DZD | Algeria Dinars | 99.2654544315 | 0.0100739981 |
DZD | Algeria Dinars | 237.3437015458 | 0.0042132991 |
ARS | Argentina Pesos | 4.9634293411 | 0.2014736045 |
AUD | Australia Dollars | 7.1224860217 | 0.1404004159 |
AUD | Australia Dollars | 1.6790396091 | 0.5955785644 |
BSD | Bahamas Dollars | 1.5661952419 | 0.6384900000 |
BHD | Bahrain Dinars | 0.5903772964 | 1.6938320732 |
BDT | Bangladesh Taka | 107.4409935943 | 0.0093074344 |
BBD | Barbados Dollars | 3.1088975632 | 0.3216574299 |
BMD | Bermuda Dollars | 1.5661952419 | 0.6384900000 |
BRL | Brazil Reais | 2.6100330567 | 0.3831369099 |
BGN | Bulgaria Leva | 1.9248539683 | 0.5195199306 |
XOF | CFA BCEAO Francs | 655.9570000000 | 0.0015244902 |
XAF | CFA BEAC Francs | 655.9570000000 | 0.0015244902 |
CAD | Canada Dollars | 1.5876523673 | 0.6298608062 |
CLP | Chile Pesos | 711.0526398221 | 0.0014063656 |
CNY | China Yuan Renminbi | 10.9798117433 | 0.0910762428 |
COP | Colombia Pesos | 2758.8529155175 | 0.0003624695 |
XPF | Comptoirs Français du Pacifique Francs | 119.3317422434 | 0.0083800000 |
CRC | Costa Rica Colones | 769.3151031455 | 0.0012998575 |
HRK | Croatia Kuna | 7.2621340976 | 0.1377005694 |
CZK | Czech Republic Koruny | 123.6113329888 | 0.0080898731 |
CZK | Czech Republic Koruny | 25.2783912042 | 0.0395594796 |
DKK | Denmark Kroner | 7.4795219972 | 0.1336983834 |
DOP | Dominican Republic Pesos | 52.8371626807 | 0.0189260730 |
DOP | Dominican Republic Pesos | 61.9779918245 | 0.0161347596 |
XCD | East Caribbean Dollars | 4.1504173910 | 0.2409396226 |
EGP | Egypt Pounds | 8.3966076211 | 0.1190957164 |
EEK | Estonia Krooni | 15.6466400000 | 0.0639114851 |
EUR | Euro | 4.1780000000 | 0.2393489708 |
EUR | Euro | 1.0000000000 | 1.0000000000 |
FJD | Fiji Dollars | 2.3446036555 | 0.4265113200 |
FJD | Fiji Dollars | 2.8580718561 | 0.3498862346 |
XAU | Gold Ounces | 0.0017694084 | 565.1606477424 |
HKD | Hong Kong Dollars | 12.2030102273 | 0.0819469935 |
HUF | Hungary Forint | 247.9130475425 | 0.0040336723 |
XDR | IMF Special Drawing Rights | 0.9540000000 | 1.0482180294 |
ISK | Iceland Kronur | 115.0699306176 | 0.0086903676 |
ISK | Iceland Kronur | 460.9701420539 | 0.0021693379 |
INR | India Rupees | 210.1952262369 | 0.0047574820 |
INR | India Rupees | 62.7261194380 | 0.0159423221 |
IDR | Indonesia Rupiahs | 14424.9714169368 | 0.0000693242 |
IRR | Iran Rials | 43966.4145092327 | 0.0000227446 |
IRR | Iran Rials | 14037.8079531394 | 0.0000712362 |
IQD | Iraq Dinars | 1880.2173878996 | 0.0005318534 |
ILS | Israel New Shekels | 5.4581904180 | 0.1832109039 |
JMD | Jamaica Dollars | 113.1576062272 | 0.0088372318 |
JPY | Japan Yen | 163.5108459020 | 0.0061158023 |
JPY | Japan Yen | 424.9646884994 | 0.0023531367 |
JOD | Jordan Dinars | 1.1104324265 | 0.9005500705 |
KES | Kenya Shillings | 97.4173440461 | 0.0102651125 |
KES | Kenya Shillings | 302.9679399834 | 0.0033006793 |
KWD | Kuwait Dinars | 0.4162163855 | 2.4025964252 |
KWD | Kuwait Dinars | 1.5812060486 | 0.6324286458 |
LBP | Lebanon Pounds | 2366.5210105092 | 0.0004225612 |
MYR | Malaysia Ringgits | 4.9326536046 | 0.2027306355 |
MUR | Mauritius Rupees | 40.2120628358 | 0.0248681597 |
MXN | Mexico Pesos | 23.6918977588 | 0.0422085225 |
MXN | Mexico Pesos | 16.3844382841 | 0.0610335236 |
MAD | Morocco Dirhams | 11.4802658348 | 0.0871059969 |
NZD | New Zealand Dollars | 2.0023023070 | 0.4994250851 |
NOK | Norway Kroner | 20.2058368964 | 0.0494906499 |
NOK | Norway Kroner | 8.0245579414 | 0.1246174565 |
OMR | Oman Rials | 0.6029068584 | 1.6586309910 |
OMR | Oman Rials | 1.3655840342 | 0.7322874133 |
PKR | Pakistan Rupees | 100.6906921578 | 0.0099314046 |
XPD | Palladium Ounces | 0.0035474411 | 281.8933350005 |
PEN | Peru Nuevos Soles | 4.3437641936 | 0.2302150751 |
PHP | Philippines Pesos | 65.4982852167 | 0.0152675753 |
XPT | Platinum Ounces | 0.0008003042 | 1249.5249300061 |
PLN | Poland Zlotych | 3.4392864414 | 0.2907579863 |
QAR | Qatar Riyals | 5.7009306396 | 0.1754099573 |
QAR | Qatar Riyals | 3.9165393494 | 0.2553274487 |
RON | Romania New Lei | 3.6446929474 | 0.2743715354 |
RUB | Russia Rubles | 68.6687152500 | 0.0145626723 |
RUB | Russia Rubles | 36.9982301994 | 0.0270283199 |
SAR | Saudi Arabia Riyals | 5.8744853639 | 0.1702276775 |
XAG | Silver Ounces | 0.3595153564 | 2.7815223528 |
XAG | Silver Ounces | 0.0931145704 | 10.7394578043 |
SGD | Singapore Dollars | 2.1326895644 | 0.4688914958 |
SKK | Slovakia Koruny | 32.3998809692 | 0.0308643109 |
SKK | Slovakia Koruny | 32.1730818024 | 0.0310818841 |
ZAR | South Africa Rand | 11.9782611884 | 0.0834845713 |
KRW | South Korea Won | 1557.0878165672 | 0.0006422245 |
KRW | South Korea Won | 736.5025372363 | 0.0013577686 |
LKR | Sri Lanka Rupees | 168.6792276648 | 0.0059284123 |
SDG | Sudan Pounds | 3.1008238187 | 0.3224949428 |
SDG | Sudan Pounds | 3.1641059374 | 0.3160450439 |
SEK | Sweden Kronor | 9.3744616204 | 0.1066727926 |
CHF | Switzerland Francs | 5.6787713981 | 0.1760944278 |
CHF | Switzerland Francs | 1.6229698194 | 0.6161544029 |
TWD | Taiwan New Dollars | 47.5136650535 | 0.0210465768 |
THB | Thailand Baht | 49.4073971882 | 0.0202398842 |
TTD | Trinidad and Tobago Dollars | 9.8043822067 | 0.1019952077 |
TND | Tunisia Dinars | 1.2056580369 | 0.8294225803 |
TND | Tunisia Dinars | 1.8239909787 | 0.5482483256 |
TRY | Turkey New Lira | 2.0106814515 | 0.4973438230 |
AED | United Arab Emirates Dirhams | 5.7518520259 | 0.1738570456 |
GBP | United Kingdom Pounds | 0.7898087676 | 1.2661292721 |
USD | United States Dollars | 1.5661952419 | 0.6384900000 |
VEF | Venezuela Bolivares Fuertes | 14.3805772996 | 0.0695382375 |
VEF | Venezuela Bolivares Fuertes | 3.3630910429 | 0.2973455037 |
VND | Vietnam Dong | 25228.2729023791 | 0.0000396381 |
ZMK | Zambia Kwacha | 5411.2045607605 | 0.0001848017 |
DynamicTable should be fast enough to handle hundreds or thousands of rows. Sorting and filtering is run on a disconnected DOM tree. A quick manual test in the latest Google Chrome and Firefox on my MacBook Pro 2.3GHz Intel Core i7 showed that sorting on a table with 2000 rows was instant, a very little slowdown was observable with more than 6000 rows.
There are four default sort functions available at this time (alphanumeric, numbers, czech and english date formats)
but new custom sort or even filter function can be added very easily either through an options object passed as the second argument to the
DynamicTable
constructor function or
as a direct extension of DynamicTable.prototype.sortFunctions
object and rewrite of DynamicTable.prototype.filterFunction
.
UI controls added by DynamicTable can be styled in CSS. Please consult the documentation available on Github for
more information.