• In v2.28.5 a scrollerComplete event is now triggered on the table once the scroller has completed rendering.
  • In v2.22.2,
    • Add support for multiple tbodies in fixed columns:
      • *WARN* colspans within information only tbodies are still problematic!
      • If a colspan is to be used with fixed columns, then split it so that the colspan splits at the edge of fixed column; please see this comment for more details & a demo.
    • The horizontal scrollbar no longer appears under the fixed column:
      • There is now a gap visible below the content when scrolled to the bottom.
      • This gap is filled by a div and can be styled by targeting the tablesorter-scroller-bar-spacer class name. See the css code block for an example.
    • Removed:
      • The automatic setting of the widthFixed option to true.
      • Extra colgroup which were copied into each table clone.
      • Extra hidden elements in the fixed column.
    • Updated RTL (right-to-left) support:
      • Changed the default class from tablesorter-scroller-rtl to ts-scroller-rtl, which is added to the table element to indicate where the fixed column is placed.
      • RTL support does require the direction: rtl css setting to be applied to the table wrapper.
    • Fixed slow mousewheel scrolling when a fixed column is active in Firefox & older versions of Internet Explorer.
    • Fixed filtering of table content causing the fixed column to misalign; especially when few to no results are found.
    • Added compatibility to the following widgets:
      • pager
      • columnSelector
    • Thanks to TheSin- for all the work he put into updating this widget... he really didn't like that scrollbar under the fixed column LOL.
  • This widget can not be applied to the original plugin and requires jQuery version 1.7+ to function properly; if you need to make it work with older versions of jQuery and the plugin, please use this version of the widget.
  • This widget was originally written by Connell & Associates, Inc. and is dual-licensed under the MIT and GPL licenses. It has been modified to work with tablesorter version 2.9+.

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
1Sherry
2Markella
3Lee
4Sherrye
5Juanito
6Andre
7Sajid
8Heidi
9Ganesh
10Regine
11Wichaya
12Douglass
13Prince
14Lola
15Dainius
16Aisha
17Maria
18Otilia
19Jian
20Tanny
21Alejandro
22Yolanda
23Azra
24Cassandra
25Theodore
26Susi
27Corazon
28Khosrow
29Melgema
30Chun
31Dwayne
32Joshua
33Shawn
34Rupa
35Gia
36Tyetha
37Gregory
38Yelena
39Thursday
40Melinda
41Latasha
42Kenneth
43Francine
44Marie
45Stanley
46Furdella
47Talatha
48Brent
49Melissa
50Guadalupe
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 Email Notes
1SherryMills2233792 Sit RdNE69836(627) 124-8760DRamirez@massa.lysagittis amet mattis facilisis vitae molestie nec dolor id sed
2MarkellaLessenberry8955979 Sit LnVA97761(768) 233-5399SPeltier@pulvinar.netelementum nullam lacus elit magna libero sed dolor pulvinar orci
3LeeTrenkelbach7195656 Adipiscing AveID30972(149) 293-0691LSheppard@lectus.netvestibulum at rutrum molestie convallis vestibulum nec egestas consequat vitae
4SherryeLlc9082348 Pharetra StUT50740(772) 682-4268MAltar@turpis.iosit elit consequat amet elit consectetur vestibulum vel quis consequat
5JuanitoLindall5345181 Lacus LnID71689(528) 174-6999CKeen@augue.lydui porttitor vestibulum mattis ipsum nunc et morbi dolor ipsum
6AndreFuller7168224 Pulvinar AveWY12382(654) 593-0007AMelvin@sed.netdolor curabitur nec molestie lacus odio id velit sed neque
7SajidCattanach9973762 Ac RdWA16719(425) 909-2771BMaas@ac.orgmorbi tincidunt ac sollicitudin nec ac orci vitae donec non
8HeidiRush7381425 Porta RdSD14708(341) 095-7183DSchrag@sapien.netnullam sed aliquam turpis et sagittis libero sed tellus dui
9GaneshComeau3852641 Hendrerit DrMT66612(201) 977-9765SBurks@ipsum.lysit vestibulum ac pretium eget augue sit augue sagittis tellus
10RegineMarina4796204 Ac RdWI55667(824) 223-9924VPeschke@pharetra.orgamet fringilla vitae tortor vestibulum egestas eget eget amet sed
11WichayaThomas487861 Risus DrKY63224(599) 823-8970BMohamed@adipiscing.lyplacerat dolor pulvinar nec morbi amet porta sagittis lacus magna
12DouglassHolliday4888829 Sit AveIA86970(113) 897-8276CLieb@convallis.iodolor magna id amet lorem eros ipsum magna non aliquam
13PrinceSchwartzberg7901757 Sit CtIL94739(299) 471-3039DFavus@quis.orgmagna tincidunt ipsum hendrerit ac vitae tortor consequat magna elit
14LolaHensley4868159 Dui RdMN88877(788) 031-7392MBradley@scelerisque.orgsuspendisse donec placerat nec suspendisse lacus ipsum elementum at lorem
15DainiusFinn3556072 Massa DrVT75787(638) 345-2650MWilcox@velit.lymorbi pretium dui dolor elit sed non vestibulum sit dui
16AishaSchuhmann3289709 Sagittis LnND44161(147) 281-5251GDech@mi.commassa sed placerat libero egestas at massa sagittis libero orci
17MariaPeacock2692241 Amet AveMO81339(656) 079-5964POliva@tincidunt.orgac hendrerit molestie ipsum facilisis massa odio fringilla hendrerit neque
18OtiliaDenbesten7781965 Nunc CtSC98692(985) 745-0452SWieber@porttitor.netaliquam orci odio id ac magna magna aenean sagittis lectus
19JianSanchez7966439 Sit LnOR24879(168) 754-6725AVrtis@porttitor.netsapien ipsum nullam pretium quis tincidunt tincidunt sit mattis porttitor
20TannyWieland8147331 Et RdSD65216(414) 322-1606ACasariego@et.orgodio augue in id lacus tincidunt morbi tempor orci tincidunt
21AlejandroSidaway9958125 Placerat RdVA98301(202) 112-1194RHaag@nullam.lylacus aliquam et sagittis etiam aenean lorem ipsum non facilisis
22YolandaSwanson530276 Amet CtVT42999(621) 796-4436TDenard@lectus.govlacus vitae quis dui orci ipsum odio pulvinar et nunc
23AzraFilleul443499 Sagittis DrOK59700(485) 530-0532LSwetland@consectetur.netmagna mattis sollicitudin placerat vel facilisis sed ac non et
24CassandraLabrucherie6066849 Tellus CtSC44245(960) 044-9381WLafave@lectus.ioac nullam magna ante sapien tellus tincidunt eros magna sagittis
25TheodoreSaver1505 Tincidunt AveIL58210(152) 001-4978KTorres@sed.ioac tincidunt nec rutrum pulvinar id aliquam placerat pharetra placerat
26SusiMurphy9001614 Hendrerit StAZ80212(532) 030-5050ZRingling@sit.ioquis odio et sapien sit amet eros et augue turpis
27CorazonLawrence5773571 Facilisis RdCA35195(318) 200-2692REckhart@scelerisque.iotincidunt sit dolor mi donec magna massa vel suspendisse placerat
28KhosrowFisher8024323 Tortor LnAK38949(493) 277-9670FHarmati@magna.lylectus tortor ac ipsum sagittis lacus dolor ac fringilla nec
29MelgemaLopez8931738 Vestibulum LnMS32638(953) 255-2707ABurgin@tortor.lymolestie at vel at placerat pharetra consequat dolor nunc placerat
30ChunLester9289681 Vestibulum CtND21333(474) 719-0476ETierney@pulvinar.govvestibulum ipsum tincidunt placerat eros turpis morbi ipsum sit malesuada
31DwayneBalasubramanian4183129 Pharetra DrSD57558(457) 589-4620ESyner@aenean.comamet sit nec amet lectus augue consequat consectetur vel sed
32JoshuaWilliamson7026313 Vestibulum StNJ39057(346) 084-7444VFeldman@elit.lysit tempor at lacus libero lorem sit nullam tempor aliquam
33ShawnDartmann1244892 Aliquam RdIA17745(500) 390-3779RNesbitt@massa.netsit sapien magna libero augue consectetur fringilla orci ac tortor
34RupaHelgren5945944 Sed AveCO96680(174) 841-4348FShebish@morbi.netat elementum neque ac in consequat elementum magna vitae mattis
35GiaMarks6352519 Convallis DrGA66324(188) 657-9140SForsyth@adipiscing.govpharetra pulvinar amet dui elementum suspendisse et odio tellus amet
36TyethaAhn5439900 Eros CtPA53390(482) 686-6141LHobbs@non.iopulvinar lorem quis fringilla eget velit sed augue rutrum augue
37GregoryChristine527751 Ipsum RdAK44543(258) 666-2073HCrooker@donec.commassa vitae dolor sollicitudin consectetur sollicitudin malesuada massa velit egestas
38YelenaShanoski6461612 Donec AveKY30729(905) 301-3407JMcmenamin@massa.govsapien rutrum adipiscing et sed sollicitudin vestibulum pharetra at neque
39ThursdayHelm6665568 Nec RdNE94390(487) 403-7019RMorin@sed.orgrisus hendrerit sollicitudin vestibulum placerat lorem eros consequat lorem magna
40MelindaOliva5256973 Rutrum CtIA38519(964) 234-5172FStephens@in.comdolor lacus nec odio in etiam facilisis lorem ipsum et
41LatashaSlocum2108374 Fringilla StNV23913(678) 453-4263JWelchert@id.govdonec massa dolor elementum scelerisque risus lacus id lorem in
42KennethZazzara2693364 Tempor DrMO30642(874) 633-3017TGarayan@tincidunt.lysollicitudin nullam egestas aenean molestie velit nec sed tincidunt scelerisque
43FrancineDaniels3662141 Amet RdOH90786(856) 781-7309SIngham@pretium.lyegestas amet vel ac pretium lacus nec tortor facilisis et
44MarieKrebs1244229 Sit LnDE41786(572) 023-1295EClagg@curabitur.iolacus elit sagittis quis nec vestibulum malesuada mattis morbi etiam
45StanleyZehnacker4564610 Odio StVT70223(257) 234-6755HPennell@morbi.govvel aliquam mattis libero sed pharetra donec malesuada pharetra lectus
46FurdellaToffoli9518366 Placerat RdAZ20381(740) 422-8726YEarls@morbi.netnon aliquam neque tortor egestas pulvinar tempor amet molestie lorem
47TalathaNye8086884 Dolor DrMS97282(589) 157-7730DAcosta@rutrum.govipsum turpis vestibulum at convallis sit neque elementum sed adipiscing
48BrentVollrath4795362 Eget DrMO74989(664) 642-4525YMarina@sollicitudin.netmassa elementum elit pretium malesuada mi vestibulum non aliquam neque
49MelissaQuintana4051302 Lacus DrPA38853(354) 903-9363AMarrinson@lacus.iomorbi quis neque placerat malesuada tincidunt morbi risus at tortor
50GuadalupeEseltine2065495 Rutrum CtAR37546(540) 500-5816TLester@morbi.comporttitor 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
NameMajorSexEnglishJapaneseCalculusGeometry
Student01Languagesmale80707580
Student02Mathematicsmale908810090
Student03Languagesfemale85958085
Student04Languagesmale6055100100
Student05Languagesfemale68809580
Student06Mathematicsmale1009910090
Student07Mathematicsmale85689090
Student08Languagesmale100909085
Student09Mathematicsmale80506575
Student10Languagesmale8510010090
Student11Languagesmale8685100100
Student12Mathematicsfemale100757085
Student13Languagesfemale1008010090
Student14Languagesfemale50455590
Student15Languagesmale953510090
Student16Languagesfemale100503070
Student17Languagesfemale801005565
Student18Mathematicsmale30495575
Student19Languagesmale68908870
Student20Mathematicsmale40454080
Student21Languagesmale5045100100
Student22Mathematicsmale1009910090
Student23Languagesfemale85808080
student23Mathematicsmale8277079
student24Languagesfemale100911382
student25Mathematicsmale22968253
student26Languagesfemale37295659
student27Mathematicsmale86826923
student28Languagesfemale4425431
student29Mathematicsmale77472238
student30Languagesfemale19352310
student31Mathematicsmale90271750
student32Languagesfemale60753338
student33Mathematicsmale4313715
student34Languagesfemale77978144
student35Mathematicsmale5815195
student36Languagesfemale70617094
student37Mathematicsmale6036184
student38Languagesfemale6339011
student39Mathematicsmale50463238
student40Languagesfemale5175253
student41Mathematicsmale43342878
student42Languagesfemale11896095
student43Mathematicsmale48921888
student44Languagesfemale8225973
student45Mathematicsmale91733739
student46Languagesfemale481210
student47Mathematicsmale8910611
student48Languagesfemale90322118
student49Mathematicsmale42494972
student50Languagesfemale56376754

Half-width demo

Account #
First Name
Last Name
Age
Total
Discount
Diff
Account #
First Name
Last Name
Age
Total
Discount
Diff
Account #First NameLast NameAgeTotalDiscountDiff
A43PeterParker289.9920.3%+3
A255JohnHood3319.9925.1%-7
A33ClarkKent1815.4944.2%-13
A11BruceAlmighty45153.1944%+19
A102BruceEvans56153.1923%+9
A23MikePeters225.6920.3%+2
A55LeslieKent3315.9925.1%-3
A3FrankMint4412.5944.2%-12
A21JoeThomas4515.2544%+12
A12TessEvans6613.5923%+4
A21PeterDunn122.9921.1%+2
A33HarryJones1319.4922.2%-6
A13JohnJames1613.8942.1%-13
A71NickParker4513.8944%+29
A21CharlesDunn1915.4922%+3
A42TeraJones8314.1913%+5
A51PaulDaniels765.9920%+1
A36HarveyPhillips8422.5023%+2
A5JamesMicheal1112.9944.4%-3
A1NormaHarry4312.3941%-9
A91CharleyDuncan2214.4412%-1