Notes

  • In v2.22.0,
    • Horizontal scrollbar now only appears on overflow.
    • border-box is now applied to all tables with scroller widget applied.
    • Fixed columns no longer have pointer events disabled.
    • Fixed column vertical scrollbar is now hidden in IE9 & older.
    • Fixed tabbing through fixed column header cells & inputs.
    • The "setFixedColumnSize" can now be called with no set size to refresh the fixed column.
    • Add scroller_addFixedOverlay option which when true, adds an overlay on the fixed columns for styling.
    • Refresh column sizes after update.
  • In v2.21.3
    • * NOTE * Prior to v2.21.3, this widget would work with jQuery v1.4.4+, now it requires jQuery v1.7+.
    • The scroller widget was almost completely rewritten! The functionality is the same, but it now allows the adding of fixed columns!
    • Added scroller_fixedColumns which allows setting the number of fixed columns to add to the scroller (see options section for more details).
    • Added scroller_rowHighlight which adds a hover highlight class name to the row in both the fixed column and main table (see options section for more details).
    • Note:
      • Yes, there are some alignment & padding issues when using the jQuery UI theme with a fixed column, I'll look into resolving this; all other themes are nearly pixel perfect.
      • The fixed column widget includes extra css to prevent tbody cell content from wrapping (see the css code below); it was for demo purposes only, it is not a requirement.
      • This update does not include optimizations to allow this widget to work with very large tables; so please be conscious of this fact.
      • A lot of Firefox tweaks were needed to make it work! I need to investigate why the mousewheel scrolling is so slow (at least in Firefox for Windows) when a fixed column is included.
      • There were lots of other tweaks to the core and other widgets (e.g. zebra & filter widgets) to get these changes to work seamlessly, so please make sure to update everything!
  • In v2.21.1, columns now line up, especially while scrolling horizontally. It may not be pixel perfect, but it looks pretty good if table css "box-sizing" is set to "border-box".
  • In v2.21.0
    • This widget was updated to include the tfoot rows.
    • To maintain the column widths across all copied tables:
      • The widthFixed options is now forcibly set to true; I apologize if this causes any inconvience.
      • This option adds a <colgroup> containing percentage width <col> elements to each section of the scroller.
      • If this option does cause issues, use css to set each column width as a percentage.
  • In v2.17+
    • The scroller widget will now work properly with predefined column widths.
    • Shrinking the browser window will now hide the header overflow.
    • Horizontal scrolling of the table body will now properly horizontally scroll the header.
    • Changed the default scroll bar width from 17 to 18.
    • Added scroller_upAfterSort option.
  • This widget can not be applied to the original plugin and requires jQuery version 1.4+ 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+.

Options

Scroller widget defaults (added inside of tablesorter widgetOptions)

TIP! Click on the link in the function column to reveal full details (or toggle|show|hide all) or double click to update the browser location.
OptionDefaultDescription
scroller_height 300 Set the height of the scroll window in pixels.
null Set the width of the scroll bar in pixels (v2.19.0)

As of v2.19.0, this option's default was changed to null because internal code was added to detect the scroll bar width which changes dramatically depending on the browser window zoom level.

If you are using a custom scroll bar plugin, this option will still accept a scroll bar width value which overrides the scroll bar width auto-detection.
true

When true, the scroller automatically scrolls the inner window back to the top after sorting.

Set this option to false to prevent this behaviour, or to stop the window from scrolling after interacting with a table cell (e.g. clicking on a checkbox); new in v2.17.3
true Bring the header into view while scrolling.

When true, this option makes the table header jump into view when the table body is not scolled to the top and while scrolling up the page. It's not perfect, but it works. Disable it as desired.

* To see the difference, toggle the button in the demo below, then scroll down & up the page using a mouse wheel with the cursor at the horizontal center of the page and about 100 pixels from the top, so the cursor is within the table body.

0 This allows setting the number of fixed columns to add to the scroller (v2.21.3).

It's not 100% pixel-perfect in alignment, especially not with a jQuery UI theme, but it looks good with the other themes.

If the content is set a RTL direction, add a class name of tablesorter-scroller-rtl (name set in $.tablesorter.css.scrollerRtl) to the table to align the fixed header on the right.

false Setting this to true will add a fixed overlay which can be used for styling (v2.22.0).

A class name of "tablesorter-scroller-fixed-panel" is added to the overlay.

Here is are two examples:

Semi-transparent overlay*

div.tablesorter-scroller-fixed-panel {
  background-color: rgba( 0, 0, 0, 0.4);
  z-index: 2;
  opacity: 0.15;
  margin-top: 10px;
  margin-bottom: 15px;
}

Black border*

div.tablesorter-scroller-fixed-panel {
  margin-top: 10px;
  margin-bottom: 15px;
  border-right: 2px solid black;
}

* Demos by TheSin- from issue 887.

*WARNING* interacting with elements under this overlay requires that the browser supports pointer-events.

"hover" Set this to a class name to use when hovering over a fixed column row (v2.21.3).

This option adds a hover highlight class name to the hovered row in both the fixed column and main table to ensure the hover highlight shows up in both areas.

If this highlighting causes unnecessary lag, it can be disabled by setting this option to an empty string.

All current themes have been updated to use this class name for row highlighting; adjust any custom themes as necessary.

Deprecated/Removed Options
"s_" This option contains a prefix string which is added to a random number (Removed).

This option was been completely removed in v2.18.0 as the id is now obtained from the unique namespace.

Methods

Change Fixed Column Size Dynamically

Set the number of fixed columns on any table with a scroller widget applied as follows:
$( 'table' ).trigger( 'setFixedColumnSize', size );

Where size is a value between zero and one less than the total number of columns.

If size is:
  • A non-integer, it will be rounded down.
  • Zero or less, no fixed columns will be applied.
  • Undefined, the current number of fixed columns will be refreshed.

CSS


	

Javascript


	

Demo

Choose Theme:

scroller_jumpToHeader : true (see the note above)*
scroller_upAfterSort : true

Name MajorSex 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
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

Fixed Column Demo
(Shrink the browser window if the horizontal scrollbar is not visible)

Set number of fixed columns: 2

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-8760[email protected]sagittis amet mattis facilisis vitae molestie nec dolor id sed
2MarkellaLessenberry8955979 Sit LnVA97761(768) 233-5399[email protected]elementum nullam lacus elit magna libero sed dolor pulvinar orci
3LeeTrenkelbach7195656 Adipiscing AveID30972(149) 293-0691[email protected]vestibulum at rutrum molestie convallis vestibulum nec egestas consequat vitae
4SherryeLlc9082348 Pharetra StUT50740(772) 682-4268[email protected]sit elit consequat amet elit consectetur vestibulum vel quis consequat
5JuanitoLindall5345181 Lacus LnID71689(528) 174-6999[email protected]dui porttitor vestibulum mattis ipsum nunc et morbi dolor ipsum
6AndreFuller7168224 Pulvinar AveWY12382(654) 593-0007[email protected]dolor curabitur nec molestie lacus odio id velit sed neque
7SajidCattanach9973762 Ac RdWA16719(425) 909-2771[email protected]morbi tincidunt ac sollicitudin nec ac orci vitae donec non
8HeidiRush7381425 Porta RdSD14708(341) 095-7183[email protected]nullam sed aliquam turpis et sagittis libero sed tellus dui
9GaneshComeau3852641 Hendrerit DrMT66612(201) 977-9765[email protected]sit vestibulum ac pretium eget augue sit augue sagittis tellus
10RegineMarina4796204 Ac RdWI55667(824) 223-9924[email protected]amet fringilla vitae tortor vestibulum egestas eget eget amet sed
11WichayaThomas487861 Risus DrKY63224(599) 823-8970[email protected]placerat dolor pulvinar nec morbi amet porta sagittis lacus magna
12DouglassHolliday4888829 Sit AveIA86970(113) 897-8276[email protected]dolor magna id amet lorem eros ipsum magna non aliquam
13PrinceSchwartzberg7901757 Sit CtIL94739(299) 471-3039[email protected]magna tincidunt ipsum hendrerit ac vitae tortor consequat magna elit
14LolaHensley4868159 Dui RdMN88877(788) 031-7392[email protected]suspendisse donec placerat nec suspendisse lacus ipsum elementum at lorem
15DainiusFinn3556072 Massa DrVT75787(638) 345-2650[email protected]morbi pretium dui dolor elit sed non vestibulum sit dui
16AishaSchuhmann3289709 Sagittis LnND44161(147) 281-5251[email protected]massa sed placerat libero egestas at massa sagittis libero orci
17MariaPeacock2692241 Amet AveMO81339(656) 079-5964[email protected]ac hendrerit molestie ipsum facilisis massa odio fringilla hendrerit neque
18OtiliaDenbesten7781965 Nunc CtSC98692(985) 745-0452[email protected]aliquam orci odio id ac magna magna aenean sagittis lectus
19JianSanchez7966439 Sit LnOR24879(168) 754-6725[email protected]sapien ipsum nullam pretium quis tincidunt tincidunt sit mattis porttitor
20TannyWieland8147331 Et RdSD65216(414) 322-1606[email protected]odio augue in id lacus tincidunt morbi tempor orci tincidunt
21AlejandroSidaway9958125 Placerat RdVA98301(202) 112-1194[email protected]lacus aliquam et sagittis etiam aenean lorem ipsum non facilisis
22YolandaSwanson530276 Amet CtVT42999(621) 796-4436[email protected]lacus vitae quis dui orci ipsum odio pulvinar et nunc
23AzraFilleul443499 Sagittis DrOK59700(485) 530-0532[email protected]magna mattis sollicitudin placerat vel facilisis sed ac non et
24CassandraLabrucherie6066849 Tellus CtSC44245(960) 044-9381[email protected]ac nullam magna ante sapien tellus tincidunt eros magna sagittis
25TheodoreSaver1505 Tincidunt AveIL58210(152) 001-4978[email protected]ac tincidunt nec rutrum pulvinar id aliquam placerat pharetra placerat
26SusiMurphy9001614 Hendrerit StAZ80212(532) 030-5050[email protected]quis odio et sapien sit amet eros et augue turpis
27CorazonLawrence5773571 Facilisis RdCA35195(318) 200-2692[email protected]tincidunt sit dolor mi donec magna massa vel suspendisse placerat
28KhosrowFisher8024323 Tortor LnAK38949(493) 277-9670[email protected]lectus tortor ac ipsum sagittis lacus dolor ac fringilla nec
29MelgemaLopez8931738 Vestibulum LnMS32638(953) 255-2707[email protected]molestie at vel at placerat pharetra consequat dolor nunc placerat
30ChunLester9289681 Vestibulum CtND21333(474) 719-0476[email protected]vestibulum ipsum tincidunt placerat eros turpis morbi ipsum sit malesuada
31DwayneBalasubramanian4183129 Pharetra DrSD57558(457) 589-4620[email protected]amet sit nec amet lectus augue consequat consectetur vel sed
32JoshuaWilliamson7026313 Vestibulum StNJ39057(346) 084-7444[email protected]sit tempor at lacus libero lorem sit nullam tempor aliquam
33ShawnDartmann1244892 Aliquam RdIA17745(500) 390-3779[email protected]sit sapien magna libero augue consectetur fringilla orci ac tortor
34RupaHelgren5945944 Sed AveCO96680(174) 841-4348[email protected]at elementum neque ac in consequat elementum magna vitae mattis
35GiaMarks6352519 Convallis DrGA66324(188) 657-9140[email protected]pharetra pulvinar amet dui elementum suspendisse et odio tellus amet
36TyethaAhn5439900 Eros CtPA53390(482) 686-6141[email protected]pulvinar lorem quis fringilla eget velit sed augue rutrum augue
37GregoryChristine527751 Ipsum RdAK44543(258) 666-2073[email protected]massa vitae dolor sollicitudin consectetur sollicitudin malesuada massa velit egestas
38YelenaShanoski6461612 Donec AveKY30729(905) 301-3407[email protected]sapien rutrum adipiscing et sed sollicitudin vestibulum pharetra at neque
39ThursdayHelm6665568 Nec RdNE94390(487) 403-7019[email protected]risus hendrerit sollicitudin vestibulum placerat lorem eros consequat lorem magna
40MelindaOliva5256973 Rutrum CtIA38519(964) 234-5172[email protected]dolor lacus nec odio in etiam facilisis lorem ipsum et
41LatashaSlocum2108374 Fringilla StNV23913(678) 453-4263[email protected]donec massa dolor elementum scelerisque risus lacus id lorem in
42KennethZazzara2693364 Tempor DrMO30642(874) 633-3017[email protected]sollicitudin nullam egestas aenean molestie velit nec sed tincidunt scelerisque
43FrancineDaniels3662141 Amet RdOH90786(856) 781-7309[email protected]egestas amet vel ac pretium lacus nec tortor facilisis et
44MarieKrebs1244229 Sit LnDE41786(572) 023-1295[email protected]lacus elit sagittis quis nec vestibulum malesuada mattis morbi etiam
45StanleyZehnacker4564610 Odio StVT70223(257) 234-6755[email protected]vel aliquam mattis libero sed pharetra donec malesuada pharetra lectus
46FurdellaToffoli9518366 Placerat RdAZ20381(740) 422-8726[email protected]non aliquam neque tortor egestas pulvinar tempor amet molestie lorem
47TalathaNye8086884 Dolor DrMS97282(589) 157-7730[email protected]ipsum turpis vestibulum at convallis sit neque elementum sed adipiscing
48BrentVollrath4795362 Eget DrMO74989(664) 642-4525[email protected]massa elementum elit pretium malesuada mi vestibulum non aliquam neque
49MelissaQuintana4051302 Lacus DrPA38853(354) 903-9363[email protected]morbi quis neque placerat malesuada tincidunt morbi risus at tortor
50GuadalupeEseltine2065495 Rutrum CtAR37546(540) 500-5816[email protected]porttitor sit massa ipsum ac massa ac hendrerit vitae malesuada