CSS
/* Fixed column scroll bar spacer styling */
.tablesorter-scroller-bar-spacer {
background: #eee;
}
/* add border to right side (LTR pages) of fixed column */
.tablesorter-scroller-fixed:after {
content: '';
border-right: 1px solid #444;
width: 1px;
position: absolute;
top: 0;
bottom: 0;
z-index: 2;
/* set to zero for non-jquery ui themes; use "left" here for RTL pages */
right: 0;
/* match the margins set to the table to keep the border the same height as the table */
margin: 10px 0 15px;
}
/* using-x-theme added by the demo code */
.using-jui-theme .tablesorter-scroller-fixed:after {
/* use "left" here for RTL pages */
right: 0;
}
.using-green-theme .tablesorter-scroller-fixed:after,
.using-black-ice-theme .tablesorter-scroller-fixed:after,
.using-dark-theme .tablesorter-scroller-fixed:after,
.using-dropbox-theme .tablesorter-scroller-fixed:after {
/* match the margins set to the table to keep the border the same height as the table */
margin: 0;
}
/* OPTIONAL CSS! */
#fixed-columns-table tbody td {
/* force "Notes" column to not wrap, so we get a horizontal scrolling demo! */
white-space: nowrap;
/* Add min column width, or "Index" column filter gets too narrow to use */
min-width: 60px;
}
Javascript
$(function() {
$('.tablesorter').tablesorter({
theme: 'jui',
showProcessing: true,
headerTemplate : '{content} {icon}',
widgets: [ 'uitheme', 'zebra', 'filter', 'scroller' ],
widgetOptions : {
scroller_height : 300,
// scroll tbody to top after sorting
scroller_upAfterSort: true,
// pop table header into view while scrolling up the page
scroller_jumpToHeader: true,
// In tablesorter v2.19.0 the scroll bar width is auto-detected
// add a value here to override the auto-detected setting
scroller_barWidth : null
// scroll_idPrefix was removed in v2.18.0
// scroller_idPrefix : 's_'
}
});
var startFixedColumns = 2;
$('#fixed-columns-table').tablesorter({
theme: 'jui',
showProcessing: true,
headerTemplate : '{content} {icon}',
widgets: [ 'uitheme', 'zebra', 'filter', 'scroller' ],
widgetOptions : {
// scroll tbody to top after sorting
scroller_upAfterSort: true,
// pop table header into view while scrolling up the page
scroller_jumpToHeader: true,
scroller_height : 300,
// set number of columns to fix
scroller_fixedColumns : startFixedColumns,
// add a fixed column overlay for styling
scroller_addFixedOverlay : false,
// add hover highlighting to the fixed column (disable if it causes slowing)
scroller_rowHighlight : 'hover',
// bar width is now calculated; set a value to override
scroller_barWidth : null
}
});
// use jQuery UI slider to change the fixed column size
$( '#slider' ).slider({
value : startFixedColumns,
min : 0,
max : 4,
step : 1,
slide : function( event, ui ) {
// page indicator
$( '.fixed-columns' ).text( ui.value );
// method to update the fixed column size
$( '#fixed-columns-table').trigger( 'setFixedColumnSize', ui.value );
}
});
// update column value display
$( '.fixed-columns' ).text( startFixedColumns );
});
Demo
Fixed columns | Full-width | Half-width
Choose Theme:scroller_jumpToHeader : true (see the note above)*
scroller_upAfterSort : true
Fixed Column Demo
(Shrink the browser window if the horizontal scrollbar is not visible)
Set number of fixed columns: 2
Index |
First Name |
---|---|
1 | Sherry |
2 | Markella |
3 | Lee |
4 | Sherrye |
5 | Juanito |
6 | Andre |
7 | Sajid |
8 | Heidi |
9 | Ganesh |
10 | Regine |
11 | Wichaya |
12 | Douglass |
13 | Prince |
14 | Lola |
15 | Dainius |
16 | Aisha |
17 | Maria |
18 | Otilia |
19 | Jian |
20 | Tanny |
21 | Alejandro |
22 | Yolanda |
23 | Azra |
24 | Cassandra |
25 | Theodore |
26 | Susi |
27 | Corazon |
28 | Khosrow |
29 | Melgema |
30 | Chun |
31 | Dwayne |
32 | Joshua |
33 | Shawn |
34 | Rupa |
35 | Gia |
36 | Tyetha |
37 | Gregory |
38 | Yelena |
39 | Thursday |
40 | Melinda |
41 | Latasha |
42 | Kenneth |
43 | Francine |
44 | Marie |
45 | Stanley |
46 | Furdella |
47 | Talatha |
48 | Brent |
49 | Melissa |
50 | Guadalupe |
Index |
First Name |
Last Name |
ID |
Address |
State |
Zip |
Telephone |
Email |
Notes |
---|---|---|---|---|---|---|---|---|---|
Index |
First Name |
Last Name |
ID |
Address |
State |
Zip |
Telephone |
Email |
Notes |
---|---|---|---|---|---|---|---|---|---|
Index | First Name | Last Name | ID | Address | State | Zip | Telephone | Notes | |
1 | Sherry | Mills | 223 | 3792 Sit Rd | NE | 69836 | (627) 124-8760 | DRamirez@massa.ly | sagittis amet mattis facilisis vitae molestie nec dolor id sed |
2 | Markella | Lessenberry | 895 | 5979 Sit Ln | VA | 97761 | (768) 233-5399 | SPeltier@pulvinar.net | elementum nullam lacus elit magna libero sed dolor pulvinar orci |
3 | Lee | Trenkelbach | 719 | 5656 Adipiscing Ave | ID | 30972 | (149) 293-0691 | LSheppard@lectus.net | vestibulum at rutrum molestie convallis vestibulum nec egestas consequat vitae |
4 | Sherrye | Llc | 908 | 2348 Pharetra St | UT | 50740 | (772) 682-4268 | MAltar@turpis.io | sit elit consequat amet elit consectetur vestibulum vel quis consequat |
5 | Juanito | Lindall | 534 | 5181 Lacus Ln | ID | 71689 | (528) 174-6999 | CKeen@augue.ly | dui porttitor vestibulum mattis ipsum nunc et morbi dolor ipsum |
6 | Andre | Fuller | 716 | 8224 Pulvinar Ave | WY | 12382 | (654) 593-0007 | AMelvin@sed.net | dolor curabitur nec molestie lacus odio id velit sed neque |
7 | Sajid | Cattanach | 997 | 3762 Ac Rd | WA | 16719 | (425) 909-2771 | BMaas@ac.org | morbi tincidunt ac sollicitudin nec ac orci vitae donec non |
8 | Heidi | Rush | 738 | 1425 Porta Rd | SD | 14708 | (341) 095-7183 | DSchrag@sapien.net | nullam sed aliquam turpis et sagittis libero sed tellus dui |
9 | Ganesh | Comeau | 385 | 2641 Hendrerit Dr | MT | 66612 | (201) 977-9765 | SBurks@ipsum.ly | sit vestibulum ac pretium eget augue sit augue sagittis tellus |
10 | Regine | Marina | 479 | 6204 Ac Rd | WI | 55667 | (824) 223-9924 | VPeschke@pharetra.org | amet fringilla vitae tortor vestibulum egestas eget eget amet sed |
11 | Wichaya | Thomas | 487 | 861 Risus Dr | KY | 63224 | (599) 823-8970 | BMohamed@adipiscing.ly | placerat dolor pulvinar nec morbi amet porta sagittis lacus magna |
12 | Douglass | Holliday | 488 | 8829 Sit Ave | IA | 86970 | (113) 897-8276 | CLieb@convallis.io | dolor magna id amet lorem eros ipsum magna non aliquam |
13 | Prince | Schwartzberg | 790 | 1757 Sit Ct | IL | 94739 | (299) 471-3039 | DFavus@quis.org | magna tincidunt ipsum hendrerit ac vitae tortor consequat magna elit |
14 | Lola | Hensley | 486 | 8159 Dui Rd | MN | 88877 | (788) 031-7392 | MBradley@scelerisque.org | suspendisse donec placerat nec suspendisse lacus ipsum elementum at lorem |
15 | Dainius | Finn | 355 | 6072 Massa Dr | VT | 75787 | (638) 345-2650 | MWilcox@velit.ly | morbi pretium dui dolor elit sed non vestibulum sit dui |
16 | Aisha | Schuhmann | 328 | 9709 Sagittis Ln | ND | 44161 | (147) 281-5251 | GDech@mi.com | massa sed placerat libero egestas at massa sagittis libero orci |
17 | Maria | Peacock | 269 | 2241 Amet Ave | MO | 81339 | (656) 079-5964 | POliva@tincidunt.org | ac hendrerit molestie ipsum facilisis massa odio fringilla hendrerit neque |
18 | Otilia | Denbesten | 778 | 1965 Nunc Ct | SC | 98692 | (985) 745-0452 | SWieber@porttitor.net | aliquam orci odio id ac magna magna aenean sagittis lectus |
19 | Jian | Sanchez | 796 | 6439 Sit Ln | OR | 24879 | (168) 754-6725 | AVrtis@porttitor.net | sapien ipsum nullam pretium quis tincidunt tincidunt sit mattis porttitor |
20 | Tanny | Wieland | 814 | 7331 Et Rd | SD | 65216 | (414) 322-1606 | ACasariego@et.org | odio augue in id lacus tincidunt morbi tempor orci tincidunt |
21 | Alejandro | Sidaway | 995 | 8125 Placerat Rd | VA | 98301 | (202) 112-1194 | RHaag@nullam.ly | lacus aliquam et sagittis etiam aenean lorem ipsum non facilisis |
22 | Yolanda | Swanson | 530 | 276 Amet Ct | VT | 42999 | (621) 796-4436 | TDenard@lectus.gov | lacus vitae quis dui orci ipsum odio pulvinar et nunc |
23 | Azra | Filleul | 443 | 499 Sagittis Dr | OK | 59700 | (485) 530-0532 | LSwetland@consectetur.net | magna mattis sollicitudin placerat vel facilisis sed ac non et |
24 | Cassandra | Labrucherie | 606 | 6849 Tellus Ct | SC | 44245 | (960) 044-9381 | WLafave@lectus.io | ac nullam magna ante sapien tellus tincidunt eros magna sagittis |
25 | Theodore | Saver | 150 | 5 Tincidunt Ave | IL | 58210 | (152) 001-4978 | KTorres@sed.io | ac tincidunt nec rutrum pulvinar id aliquam placerat pharetra placerat |
26 | Susi | Murphy | 900 | 1614 Hendrerit St | AZ | 80212 | (532) 030-5050 | ZRingling@sit.io | quis odio et sapien sit amet eros et augue turpis |
27 | Corazon | Lawrence | 577 | 3571 Facilisis Rd | CA | 35195 | (318) 200-2692 | REckhart@scelerisque.io | tincidunt sit dolor mi donec magna massa vel suspendisse placerat |
28 | Khosrow | Fisher | 802 | 4323 Tortor Ln | AK | 38949 | (493) 277-9670 | FHarmati@magna.ly | lectus tortor ac ipsum sagittis lacus dolor ac fringilla nec |
29 | Melgema | Lopez | 893 | 1738 Vestibulum Ln | MS | 32638 | (953) 255-2707 | ABurgin@tortor.ly | molestie at vel at placerat pharetra consequat dolor nunc placerat |
30 | Chun | Lester | 928 | 9681 Vestibulum Ct | ND | 21333 | (474) 719-0476 | ETierney@pulvinar.gov | vestibulum ipsum tincidunt placerat eros turpis morbi ipsum sit malesuada |
31 | Dwayne | Balasubramanian | 418 | 3129 Pharetra Dr | SD | 57558 | (457) 589-4620 | ESyner@aenean.com | amet sit nec amet lectus augue consequat consectetur vel sed |
32 | Joshua | Williamson | 702 | 6313 Vestibulum St | NJ | 39057 | (346) 084-7444 | VFeldman@elit.ly | sit tempor at lacus libero lorem sit nullam tempor aliquam |
33 | Shawn | Dartmann | 124 | 4892 Aliquam Rd | IA | 17745 | (500) 390-3779 | RNesbitt@massa.net | sit sapien magna libero augue consectetur fringilla orci ac tortor |
34 | Rupa | Helgren | 594 | 5944 Sed Ave | CO | 96680 | (174) 841-4348 | FShebish@morbi.net | at elementum neque ac in consequat elementum magna vitae mattis |
35 | Gia | Marks | 635 | 2519 Convallis Dr | GA | 66324 | (188) 657-9140 | SForsyth@adipiscing.gov | pharetra pulvinar amet dui elementum suspendisse et odio tellus amet |
36 | Tyetha | Ahn | 543 | 9900 Eros Ct | PA | 53390 | (482) 686-6141 | LHobbs@non.io | pulvinar lorem quis fringilla eget velit sed augue rutrum augue |
37 | Gregory | Christine | 527 | 751 Ipsum Rd | AK | 44543 | (258) 666-2073 | HCrooker@donec.com | massa vitae dolor sollicitudin consectetur sollicitudin malesuada massa velit egestas |
38 | Yelena | Shanoski | 646 | 1612 Donec Ave | KY | 30729 | (905) 301-3407 | JMcmenamin@massa.gov | sapien rutrum adipiscing et sed sollicitudin vestibulum pharetra at neque |
39 | Thursday | Helm | 666 | 5568 Nec Rd | NE | 94390 | (487) 403-7019 | RMorin@sed.org | risus hendrerit sollicitudin vestibulum placerat lorem eros consequat lorem magna |
40 | Melinda | Oliva | 525 | 6973 Rutrum Ct | IA | 38519 | (964) 234-5172 | FStephens@in.com | dolor lacus nec odio in etiam facilisis lorem ipsum et |
41 | Latasha | Slocum | 210 | 8374 Fringilla St | NV | 23913 | (678) 453-4263 | JWelchert@id.gov | donec massa dolor elementum scelerisque risus lacus id lorem in |
42 | Kenneth | Zazzara | 269 | 3364 Tempor Dr | MO | 30642 | (874) 633-3017 | TGarayan@tincidunt.ly | sollicitudin nullam egestas aenean molestie velit nec sed tincidunt scelerisque |
43 | Francine | Daniels | 366 | 2141 Amet Rd | OH | 90786 | (856) 781-7309 | SIngham@pretium.ly | egestas amet vel ac pretium lacus nec tortor facilisis et |
44 | Marie | Krebs | 124 | 4229 Sit Ln | DE | 41786 | (572) 023-1295 | EClagg@curabitur.io | lacus elit sagittis quis nec vestibulum malesuada mattis morbi etiam |
45 | Stanley | Zehnacker | 456 | 4610 Odio St | VT | 70223 | (257) 234-6755 | HPennell@morbi.gov | vel aliquam mattis libero sed pharetra donec malesuada pharetra lectus |
46 | Furdella | Toffoli | 951 | 8366 Placerat Rd | AZ | 20381 | (740) 422-8726 | YEarls@morbi.net | non aliquam neque tortor egestas pulvinar tempor amet molestie lorem |
47 | Talatha | Nye | 808 | 6884 Dolor Dr | MS | 97282 | (589) 157-7730 | DAcosta@rutrum.gov | ipsum turpis vestibulum at convallis sit neque elementum sed adipiscing |
48 | Brent | Vollrath | 479 | 5362 Eget Dr | MO | 74989 | (664) 642-4525 | YMarina@sollicitudin.net | massa elementum elit pretium malesuada mi vestibulum non aliquam neque |
49 | Melissa | Quintana | 405 | 1302 Lacus Dr | PA | 38853 | (354) 903-9363 | AMarrinson@lacus.io | morbi quis neque placerat malesuada tincidunt morbi risus at tortor |
50 | Guadalupe | Eseltine | 206 | 5495 Rutrum Ct | AR | 37546 | (540) 500-5816 | TLester@morbi.com | porttitor sit massa ipsum ac massa ac hendrerit vitae malesuada |
Full-width demo
Name |
Major | Sex |
English |
Japanese |
Calculus |
Geometry |
---|---|---|---|---|---|---|
Name |
Major | Sex |
English |
Japanese |
Calculus |
Geometry |
---|---|---|---|---|---|---|
Name | Major | Sex | English | Japanese | Calculus | Geometry |
Student01 | Languages | male | 80 | 70 | 75 | 80 |
Student02 | Mathematics | male | 90 | 88 | 100 | 90 |
Student03 | Languages | female | 85 | 95 | 80 | 85 |
Student04 | Languages | male | 60 | 55 | 100 | 100 |
Student05 | Languages | female | 68 | 80 | 95 | 80 |
Student06 | Mathematics | male | 100 | 99 | 100 | 90 |
Student07 | Mathematics | male | 85 | 68 | 90 | 90 |
Student08 | Languages | male | 100 | 90 | 90 | 85 |
Student09 | Mathematics | male | 80 | 50 | 65 | 75 |
Student10 | Languages | male | 85 | 100 | 100 | 90 |
Student11 | Languages | male | 86 | 85 | 100 | 100 |
Student12 | Mathematics | female | 100 | 75 | 70 | 85 |
Student13 | Languages | female | 100 | 80 | 100 | 90 |
Student14 | Languages | female | 50 | 45 | 55 | 90 |
Student15 | Languages | male | 95 | 35 | 100 | 90 |
Student16 | Languages | female | 100 | 50 | 30 | 70 |
Student17 | Languages | female | 80 | 100 | 55 | 65 |
Student18 | Mathematics | male | 30 | 49 | 55 | 75 |
Student19 | Languages | male | 68 | 90 | 88 | 70 |
Student20 | Mathematics | male | 40 | 45 | 40 | 80 |
Student21 | Languages | male | 50 | 45 | 100 | 100 |
Student22 | Mathematics | male | 100 | 99 | 100 | 90 |
Student23 | Languages | female | 85 | 80 | 80 | 80 |
student23 | Mathematics | male | 82 | 77 | 0 | 79 |
student24 | Languages | female | 100 | 91 | 13 | 82 |
student25 | Mathematics | male | 22 | 96 | 82 | 53 |
student26 | Languages | female | 37 | 29 | 56 | 59 |
student27 | Mathematics | male | 86 | 82 | 69 | 23 |
student28 | Languages | female | 44 | 25 | 43 | 1 |
student29 | Mathematics | male | 77 | 47 | 22 | 38 |
student30 | Languages | female | 19 | 35 | 23 | 10 |
student31 | Mathematics | male | 90 | 27 | 17 | 50 |
student32 | Languages | female | 60 | 75 | 33 | 38 |
student33 | Mathematics | male | 4 | 31 | 37 | 15 |
student34 | Languages | female | 77 | 97 | 81 | 44 |
student35 | Mathematics | male | 5 | 81 | 51 | 95 |
student36 | Languages | female | 70 | 61 | 70 | 94 |
student37 | Mathematics | male | 60 | 3 | 61 | 84 |
student38 | Languages | female | 63 | 39 | 0 | 11 |
student39 | Mathematics | male | 50 | 46 | 32 | 38 |
student40 | Languages | female | 51 | 75 | 25 | 3 |
student41 | Mathematics | male | 43 | 34 | 28 | 78 |
student42 | Languages | female | 11 | 89 | 60 | 95 |
student43 | Mathematics | male | 48 | 92 | 18 | 88 |
student44 | Languages | female | 82 | 2 | 59 | 73 |
student45 | Mathematics | male | 91 | 73 | 37 | 39 |
student46 | Languages | female | 4 | 8 | 12 | 10 |
student47 | Mathematics | male | 89 | 10 | 6 | 11 |
student48 | Languages | female | 90 | 32 | 21 | 18 |
student49 | Mathematics | male | 42 | 49 | 49 | 72 |
student50 | Languages | female | 56 | 37 | 67 | 54 |
Half-width demo
Account # | First Name | Last Name | Age | Total | Discount | Diff |
---|---|---|---|---|---|---|
Account # | First Name | Last Name | Age | Total | Discount | Diff |
---|---|---|---|---|---|---|
Account # | First Name | Last Name | Age | Total | Discount | Diff |
A43 | Peter | Parker | 28 | 9.99 | 20.3% | +3 |
A255 | John | Hood | 33 | 19.99 | 25.1% | -7 |
A33 | Clark | Kent | 18 | 15.49 | 44.2% | -13 |
A11 | Bruce | Almighty | 45 | 153.19 | 44% | +19 |
A102 | Bruce | Evans | 56 | 153.19 | 23% | +9 |
A23 | Mike | Peters | 22 | 5.69 | 20.3% | +2 |
A55 | Leslie | Kent | 33 | 15.99 | 25.1% | -3 |
A3 | Frank | Mint | 44 | 12.59 | 44.2% | -12 |
A21 | Joe | Thomas | 45 | 15.25 | 44% | +12 |
A12 | Tess | Evans | 66 | 13.59 | 23% | +4 |
A21 | Peter | Dunn | 12 | 2.99 | 21.1% | +2 |
A33 | Harry | Jones | 13 | 19.49 | 22.2% | -6 |
A13 | John | James | 16 | 13.89 | 42.1% | -13 |
A71 | Nick | Parker | 45 | 13.89 | 44% | +29 |
A21 | Charles | Dunn | 19 | 15.49 | 22% | +3 |
A42 | Tera | Jones | 83 | 14.19 | 13% | +5 |
A51 | Paul | Daniels | 76 | 5.99 | 20% | +1 |
A36 | Harvey | Phillips | 84 | 22.50 | 23% | +2 |
A5 | James | Micheal | 11 | 12.99 | 44.4% | -3 |
A1 | Norma | Harry | 43 | 12.39 | 41% | -9 |
A91 | Charley | Duncan | 22 | 14.44 | 12% | -1 |