jQuery plugin: Tablesorter 2.0 - Child Rows with Filter Widget

# tablesorter

## Child Rows with Filter Widget

### Flexible client-side table sorting

Back to documentation

NOTE!

- Click the link in the Order # column to reveal the hidden child row cells (original demo). This option is available in the original plugin.
- The filter widget will work with the original tablesorter plugin, just include the jquery.tablesorter.widget.js file and initialize the widget as seen below.
- Combining the filter widget and pager plugin will not work as expected.
- As of v2.15.12,
  - This demo includes the pager widget.
  - For now, when combining the filter widget with pager, ensure the `removeRows` option is set to `false`.
  - Parents of child rows now have a `tablesorter-hasChildRow` class name added.
  - The last row of each page now includes any child rows. For example, on page 1, click on the "SO71783" row link and the associated child row will now show, as it should
  - NOTE! A new css definition was added to every default theme; the "filtered" class name (set by the `filter_filteredRow` widgetOption) has been added to properly hide/show child rows when filtered.
  - The additional code to always hide child row cells on `pagerChange` is no longer needed.

# Demo

: true

- If true, the child row content is included in ALL filters. Enter "cal" (california) in any column filter and the same rows show up.
- When false, child row content is ignored. Enter "cal" and no rows will be found.

Order # | Customer | PO | Date | Total
--- | --- | --- | --- | ---
SO71774 | Good Toys | PO348186287 | Jul 20, 2007 | $972.78
Shipping Address 99700 Bell Road Auburn, California 95603
SO71775 | Cycle Clearance | PO58159451 | May 6, 2007 | $2,313.13
Shipping Address 2255 254th Avenue Se Albany, Oregon 97321
SO71776 | West Side Mart | PO19952192051 | May 12, 2007 | $87.09
Shipping Address 251 The Metro Center Wokingham, England RG41 1QW
SO71777 | Demand Distributors | PO20097113391 | Apr 26, 2007 | $1,267.82
Comment Please send ATTN: Judy
Shipping Address 25102 Springwater Wenatchee, Washington 98801
SO71778 | Purchase Mart | PO19894146890 | Apr 18, 2007 | $1,503.98
Shipping Address Wrentham Village Wrentham, Massachusetts 02093
SO71779 | Initial Bike Company | PO19633118218 | Dec 20, 2007 | $48,425.55
Shipping Address 789 West Alameda Westminster, Colorado 80030
SO71780 | Nearby Cycle Shop | PO19604173239 | Aug 29, 2007 | $42,452.65
Shipping Address Burgess Hill Edward Way West Sussex, England RH15 9UD
SO71781 | Sundry Sporting Goods | PO19401117806 | Mar 9, 2008 | $29,262.41
Comment Please send ATTN: Rudolph
Shipping Address 595 Burning Street Vancouver, British Columbia V7L 4J4
SO71782 | Professional Sales and Service | PO19372114749 | Jul 27, 2007 | $43,962.79
Shipping Address 57251 Serene Blvd Van Nuys, California 91411
SO71783 | Eastside Department Store | PO19343113609 | May 15, 2007 | $92,663.56
Shipping Address 9992 Whipple Rd Union City, California 94587
SO71784 | Action Bicycle Specialists | PO19285135919 | Nov 30, 2007 | $119,960.82
Shipping Address Warrington Ldc Unit 25/2 Woolston, England WA1 4SY
SO71785 | Metro Cycle Shop | PO19169115427 | Feb 1, 2008 | $39,805.12
Comment Please send ATTN: Henry
Shipping Address 2507 Pacific Ave S Tacoma, Washington 98403
SO71786 | Greater Bike Store | PO17690128583 | Dec 7, 2007 | $4,657.19
Shipping Address 55 Lakeshore Blvd East Toronto, Ontario M4B 1V6
SO71787 | Fun Toys and Bikes | PO18038111279 | Jun 1, 2007 | $38,211.11
Shipping Address 6500 East Grant Road Tucson, Arizona 85701
SO71788 | Reliable Retail Center | PO17951176595 | Jul 10, 2007 | $1,806.12
Shipping Address 609 Evans Avenue Toronto, Ontario M4B 1V4
SO71789 | Eastside Parts Shop | PO17516128941 | May 22, 2007 | $143.50
Comment Please send ATTN: Andrew
Shipping Address 7000 Victoria Park Avenue Toronto, Ontario M4B 1V4
SO71790 | Successful Sales Company | PO17487184338 | Apr 15, 2007 | $5,306.48
Shipping Address 7009 Sw Hall Blvd. Tigard, Oregon 97223
SO71791 | Convenient Sales and Service | PO17139191080 | Nov 14, 2007 | $26,692.85
Shipping Address 950 Gateway Street Springfield, Oregon 97477
SO71792 | Corner Bicycle Supply | PO17545115036 | Mar 17, 2008 | $67,683.32
Shipping Address 2511 Baker Road Toronto, Ontario M4B 1V7
SO71793 | Mountain Toy Store | PO17226152414 | Sep 5, 2007 | $1,943.93
Comment Please send ATTN: Marvin
Shipping Address First Colony Mall Sugar Land, Texas 77478
SO71794 | Vigorous Exercise Company | PO17574111985 | Dec 14, 2007 | $87,770.74
Shipping Address 9950 Ferrand Drive, 9th Floor Toronto, Ontario M4B 1V4
SO71795 | Bike Part Wholesalers | PO17371184627 | Feb 6, 2008 | $41,224.10
Shipping Address 254a Baker Street Botany Sydney, New South Wales 1002
SO71796 | Extreme Riding Supplies | PO17052159664 | Jul 13, 2007 | $63,686.27
Shipping Address Riverside Sherman Oaks, California 91403
SO71797 | Riding Cycles | PO16501134889 | Dec 2, 2007 | $86,222.81
Comment Please send ATTN: Jon
Shipping Address Galashiels Liverpool, England L4 4HB
SO71798 | Work and Play Association | PO16994135863 | Jan 20, 2008 | $40,048.63
Shipping Address 2533 Eureka Rd. Southgate, Michigan 48195
SO71799 | Metro Sports Equipment | PO15486196616 | Oct 18, 2007 | $23,080.67
Shipping Address 6, rue des Pyrenees Saint Ouen, Loir et Cher 41100
SO71800 | Quick Parts and Service | PO15544127760 | Feb 19, 2008 | $37,253.44
Shipping Address 99954 Boul. Laurier, Local 060, Place Sainte-Foy, Quebec G1W
SO71801 | Getaway Inn | PO15515173664 | Mar 6, 2008 | $47,720.54
Comment Please send ATTN: Min
Shipping Address 54, avenue des Ternes Saint Ouen, Loir et Cher 41100
SO71802 | Blue-Ribbon Bike Company | PO15457184141 | Sep 22, 2007 | $42,013.42
Shipping Address 790 Shelbyville Road Saint Matthews, Kentucky 40207
SO71803 | World of Bikes | PO15341174104 | Mar 1, 2008 | $43,964.97
Shipping Address 660 Lindbergh Saint Louis, Missouri 63103
SO71804 | Bikes for Two | PO14906114459 | Aug 18, 2007 | $2,431.21
Shipping Address 63 West Beaver Creek Richmond Hill, Ontario L4E 3M5
SO71805 | Nationwide Supply | PO14703194514 | Jun 27, 2007 | $76,535.55
Comment Please send ATTN: Pilar
Shipping Address 4250 Concord Road Rhodes, New South Wales 2138
SO71806 | Valley Toy Store | PO14790111844 | Jun 2, 2007 | $20,261.90
Shipping Address 252851 Rowan Place Richmond, British Columbia V6B 3P7
SO71807 | Courteous Bicycle Specialists | PO14935135211 | Oct 28, 2007 | $656.84
Shipping Address 995 Crescent Richmond Hill, Ontario L4E 3M5
SO71808 | Odometers and Accessories Company | PO14761198562 | Oct 28, 2007 | $42,231.51
Shipping Address 253711 Mayfield Place, Unit 150 Richmond, British Columbia V6B 3P7
SO71809 | Fitness Bike Accessories | PO14645153239 | Jan 12, 2008 | $3,743.42
Comment Please send ATTN: John
Shipping Address Level 7 114 Albert Road Rhodes, New South Wales 2138
SO71810 | Two-Seater Bikes | PO13804148315 | May 27, 2007 | $1,093.53
Shipping Address 5700 Legacy Dr Plano, Texas 75074
SO71811 | Racing Toys | PO13717180066 | Feb 26, 2008 | $3,493.04
Shipping Address 9228 Via Del Sol Phoenix, Arizona 85004
SO71812 | Fashionable Bikes and Accessories | PO13543115747 | Apr 28, 2007 | $35,146.04
Shipping Address Sports Store At Park City Park City, Utah 84098
SO71813 | Liquidation Sales | PO13630186295 | Jan 17, 2008 | $12,707.47
Comment Please send ATTN: Jenny
Shipping Address No. 6 Millenium Court Perth, South Australia 6006
SO71814 | Our Sporting Goods Store | PO12818173864 | May 31, 2007 | $7,517.54
Shipping Address 6030 Conroy Road Ottawa, Ontario K4B 1S3
SO71815 | Thrifty Parts and Sales | PO13021155785 | Jan 1, 2008 | $1,261.44
Shipping Address Oxnard Outlet Oxnard, California 93030
SO71816 | Engineered Bike Systems | PO12992180445 | Jul 29, 2007 | $3,754.97
Shipping Address 123 Camelia Avenue Oxnard, California 93030
SO71817 | Home Town Bike Store | PO12905185178 | May 21, 2007 | $689.96
Comment Please send ATTN: Danielle
Shipping Address 955 Green Valley Crescent Ottawa, Ontario K4B 1S1
SO71818 | Utilitarian Sporting Goods | PO12470139718 | Apr 25, 2007 | $61,356.31
Shipping Address 4635 S. Harrison Blvd. Ogden, Utah 84401
SO71819 | Fabrikam Inc., West | PO12354153257 | May 19, 2007 | $41,746.15
Shipping Address 46460 West Oaks Drive Novi, Michigan 48375
SO71820 | Racing Sales and Service | PO12673129941 | Apr 26, 2007 | $68,686.02
Shipping Address 510, avenue de Villiers Orleans, Loiret 45000
SO71821 | Bike Goods | PO11977190694 | May 25, 2007 | $5,904.88
Comment Please send ATTN: Gary
Shipping Address 254075 Biscayne Blvd. North Miami Beach, Florida 33162
SO71822 | Popular Bike Lines | PO11774139099 | Dec 19, 2007 | $31,191.60
Shipping Address Level 7 80 Arthur Street Newcastle, New South Wales 2300
SO71823 | Enterprise Center | PO11310159994 | Sep 7, 2007 | $2,818.81
Shipping Address Kurfürstenstr 574 München, Hessen 80074
SO71824 | Outdoor Equipment Store | PO11455162600 | Oct 29, 2007 | $115,117.41
Shipping Address 6 Cotton Road Nashua, New Hampshire 03064
SO71825 | One Bike Company | PO11165197222 | Dec 28, 2007 | $4,824.62
Comment Please send ATTN: Shanay
Shipping Address 5 place Ville-Marie Montreal, Quebec H1Y 2H7
SO71826 | Rodeway Bike Store | PO11397155355 | Oct 29, 2007 | $40,083.06
Shipping Address Winterfeldtstr 5557 Kreditorenbuchhaltung Münster, Saarland 48001
SO71827 | Metal Processing Company | PO11107195325 | Aug 22, 2007 | $9,247.52
Shipping Address 770 Notre Datme Quest Bureau 800 Montreal, Quebec H1Y 2H7
SO71828 | Grand Industries | PO11194153355 | Aug 10, 2007 | $52,553.87
Shipping Address 6333 Cote Vertu Montreal, Quebec H1Y 2H7
SO71829 | Family Cycle Store | PO10962123279 | Jul 16, 2007 | $40,095.88
Comment Please send ATTN: James
Shipping Address 660 Saint-Jacques, Bureau 400 Montreal, Quebec H1Y 2H8
SO71830 | Petroleum Products Distributors | PO10875112195 | Nov 8, 2007 | $55,088.00
Shipping Address 20225 Lansing Ave Montreal, Quebec H1Y 2H7
SO71831 | Tachometers and Accessories | PO10295111084 | Aug 8, 2007 | $2,228.06
Shipping Address Wymbush Milton Keynes, England MK8 8DF
SO71832 | Closest Bicycle Store | PO10353140756 | Sep 3, 2007 | $39,531.61
Shipping Address Garamonde Drive, Wymbush PO Box 4023 Milton Keynes, England MK8 8ZD
SO71833 | Another Bicycle Company | PO10411123072 | Jan 26, 2008 | $70,377.54
Comment Please send ATTN: Stanley
Shipping Address 567 Sw Mcloughlin Blvd Milwaukie, Oregon 97222
SO71834 | Rustic Bike Store | PO377116268 | Feb 22, 2008 | $2,310.51
Shipping Address Buergermeister-ulrich-str 3000 Buchhaltung Augsburg, Bayern 86150
SO71835 | Running and Cycling Gear | PO870120974 | Jun 13, 2007 | $71,605.92
Shipping Address No. 60 Bellis Fair Parkway Bellingham, Washington 98225
SO71836 | Safe Cycles Shop | PO841118259 | Sep 13, 2007 | $90,216.85
Shipping Address 2681 Eagle Peak Bellevue, Washington 98004
SO71837 | Riders Company | PO1624180133 | Aug 24, 2007 | $39,989.36
Comment Please send ATTN: Kim
Shipping Address Tanger Factory Branch, Minnesota 55056
SO71838 | Cycles Sales and Repair | PO1305123041 | Sep 7, 2007 | $15,165.23
Shipping Address 3387, rue Marbeuf Bobigny, Seine Saint Denis 93000
SO71839 | Front Runner Bikes | PO1537119063 | Jan 26, 2008 | $75,173.33
Shipping Address DeSouth Square Bradenton, Florida 34205
SO71840 | Community Department Stores | PO1450191043 | Oct 2, 2007 | $1,234.39
Shipping Address 3639, rue des Grands Champs Boulogne-sur-Mer, Pas de Calais 62200
SO71841 | Rural Cycle Emporium | PO1798133189 | Nov 23, 2007 | $112,758.77
Comment Please send ATTN: Kathleen
Shipping Address 6388 Lake City Way Burnaby, British Columbia V5A 3A6
SO71842 | Price-Cutter Discount Bikes | PO1740169151 | Nov 22, 2007 | $12.91
Shipping Address 6700 Boul Taschereau Brossard, Quebec J4Z 1C5
SO71843 | Future Bikes | PO2001122796 | Jun 24, 2007 | $7,775.72
Shipping Address 67255 - 8th Street N.E., Suite 350 Calgary, Alberta T2P 2G8
SO71844 | Sales and Supply Company | PO2813198985 | Jun 12, 2007 | $48,077.41
Shipping Address Corporate Ofc A/p 123 Fourth Ave Chantilly, Virginia 20151
SO71845 | Trailblazing Sports | PO2697119362 | Mar 4, 2008 | $45,992.37
Comment Please send ATTN: Frank
Shipping Address 251340 E. South St. Cerritos, California 90703
SO71846 | Sports Store | PO2378131604 | Jul 2, 2007 | $2,711.41
Shipping Address Internet House, 3399 Science Park Cambridge, England CB4 4BZ
SO71847 | Camping and Sports Store | PO18502143784 | Jul 15, 2007 | $119,981.15
Shipping Address 400-25155 West Pender St Vancouver, British Columbia V7L 4J4
SO71848 | Locks Company | PO18763153352 | Nov 9, 2007 | $16,667.88
Shipping Address 70259 West Sunnyview Ave Visalia, California 93291
SO71849 | Principal Bike Company | PO18125130930 | Jan 18, 2008 | $25,746.16
Comment Please send ATTN: Alvaro
Shipping Address Mountain Square Upland, California 91786
SO71850 | Quitting Business Distributors | PO18241134627 | Aug 28, 2007 | $10,492.47
Shipping Address University Plaza Tampa, Florida 33602
SO71851 | Rapid Bikes | PO18299133687 | Jun 17, 2007 | $51,104.88
Shipping Address 992 St Clair Ave East Toronto, Ontario M4B 1V7
SO71852 | Painters Bicycle Specialists | PO20213171866 | Mar 24, 2008 | $10,406.62
Shipping Address 9975 Union St. Waterbury, Connecticut 06710
SO71853 | Famous Bike Shop | PO18531164420 | May 3, 2007 | $4,578.20
Comment Please send ATTN: Jim
Shipping Address 999 West Georgia St. Vancouver, Ontario V5T 1Y9
SO71854 | Helpful Sales and Repair Service | PO16385143469 | Nov 11, 2007 | $36,819.69
Shipping Address Licensing Account Seaford, Victoria 3198
SO71855 | Self-Contained Cycle Parts Company | PO18589189353 | Jun 23, 2007 | $429.62
Shipping Address 12, rue des Grands Champs Verrieres Le Buisson, Essonne 91370
SO71856 | Transport Bikes | PO16530177647 | Nov 18, 2007 | $665.43
Shipping Address 25130 South State Street Sandy, Utah 84070
SO71857 | First Cycle Store | PO16269151631 | Jan 4, 2008 | $37,400.41
Comment Please send ATTN: Mike
Shipping Address 25250 N 90th St Scottsdale, Arizona 85257
SO71858 | Thrilling Bike Tours | PO16153112278 | Oct 6, 2007 | $15,275.20
Shipping Address 4660 Rodeo Road Santa Fe, New Mexico 87501
SO71859 | Bike World | PO16182112142 | Apr 11, 2007 | $8,654.14
Shipping Address 60025 Bollinger Canyon Road San Ramon, California 94583
SO71860 | Vinyl and Plastic Goods Corporation | PO17835163979 | Feb 20, 2008 | $3,651.79
Shipping Address No. 25800-130 King Street West Toronto, Ontario M4B 1V5
SO71861 | Two Bike Shops | PO14152156429 | Nov 30, 2007 | $2,430.32
Comment Please send ATTN: Jim
Shipping Address 35525-9th Street Sw Puyallup, Washington 98371
SO71862 | Fad Outlet | PO14065190039 | Feb 19, 2008 | $1,622.62
Shipping Address 2550 Ne Sandy Blvd Portland, Oregon 97205
SO71863 | Sports Products Store | PO16124166561 | Apr 30, 2007 | $3,673.32
Shipping Address Po Box 252525 Santa Ana, California 92701
SO71864 | Good Bike Shop | PO14268188903 | Oct 9, 2007 | $37,623.76
Shipping Address 99433 S. Greenbay Rd. Racine, Wisconsin 53182
SO71865 | Neighborhood Bicycle Storehouse | PO15109136609 | May 30, 2007 | $290.23
Comment Please send ATTN: Cecilia
Shipping Address 69, boulevard Tremblay Roncq, Nord 59223
SO71866 | Exchange Parts Inc. | PO14297151936 | Jan 27, 2008 | $43,277.65
Shipping Address 7700 Green Road Raleigh, North Carolina 27603
SO71867 | Vigorous Sports Store | PO13050111529 | Jul 29, 2007 | $1,170.54
Shipping Address Banbury Oxon, England OX16 8RS
SO71868 | Cycle Merchants | PO14210134527 | Aug 15, 2007 | $1,932.67
Shipping Address 575 Rue St Amable Quebec, Quebec G1R
SO71869 | Certified Sports Supply | PO14877155420 | Feb 21, 2008 | $143.50
Comment Please send ATTN: Gabriele
Shipping Address 250551 Shellbridge Way Richmond, British Columbia V6B 3P7
SO71870 | Accessories Network | PO13195134898 | Feb 1, 2008 | $1,903.38
Shipping Address 699bis, rue des Peupliers Paris, Seine (Paris) 75008
SO71871 | Remote Bicycle Specialists | PO14239120760 | Aug 10, 2007 | $2,168.53
Shipping Address No. 2000-25080 Beaver Hall Hill Quebec, Quebec G1R
SO71872 | First Center | PO13137112099 | Jan 2, 2008 | $215.91
Shipping Address 22, rue Lafayette Pantin, Seine Saint Denis 93500
SO71873 | Incomparable Bicycle Store | PO12325121185 | Jul 5, 2007 | $5,941.29
Comment Please send ATTN: Faith
Shipping Address 99 Edgewater Drive Norwood, Massachusetts 02062

# Javascript

# HTML

    <table class="tablesorter">
      <colgroup>
        <col width="85" />
        <col width="250" />
        <col width="100" />
        <col width="90" />
        <col width="70" />
      </colgroup>
      <thead>
        <tr>
          <th>Order #</th>
          <th>Customer</th>
          <th>PO</th>
          <th>Date</th>
          <th>Total</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td rowspan="2"> <!-- rowspan="2" makes the table look nicer -->
            <a href="#" class="toggle">SO71774</a> <!-- link to toggle view of the child row -->
          </td>
          <td>Good Toys</td>
          <td>PO348186287</td>
          <td>Jul 20, 2007</td>
          <td>$972.78</td>
        </tr>
        <tr class="tablesorter-childRow">
          <td colspan="4">
            <div class="bold">Shipping Address</div>
            <div>99700 Bell Road<br>Auburn, California 95603</div>
          </td>
        </tr>
        <tr>
          <td rowspan="2"> <!-- rowspan="2" makes the table look nicer -->
            <a href="#" class="toggle">SO71775</a> <!-- link to toggle view of the child row -->
          </td>
          <td>Cycle Clearance</td>
          <td>PO58159451</td>
          <td>May 6, 2007</td>
          <td>$2,313.13</td>
        </tr>
        <tr class="tablesorter-childRow">
          <td colspan="4">
            <div class="bold">Shipping Address</div>
            <div>2255 254th Avenue Se<br>Albany, Oregon 97321</div>
          </td>
        </tr>

        <!-- View page source for complete HTML markup -->

      </tbody>
    </table>

    <div id="pager" class="pager">
      <form>
        <input type="button" value="&lt;&lt;" class="first" />
        <input type="button" value="&lt;" class="prev" />
        <input type="text" class="pagedisplay"/>
        <input type="button" value="&gt;" class="next" />
        <input type="button" value="&gt;&gt;" class="last" />
        <select class="pagesize">
          <option selected="selected"  value="10">10</option>
          <option value="20">20</option>
          <option value="30">30</option>
          <option value="40">40</option>
        </select>
      </form>
    </div>

Next up: Set an initial sorting order direction ››