Notes

  • In v2.17.8, added a new option ignoreArticlesExcept option which allows ignoring a set pattern.
  • This parser can not be applied to the original plugin.

Setup

  • Set the language (French shown below; English is set by default) to use by adding any of the following (they all do the same thing), set in order of priority (v2.8.2):
    • jQuery data data-ignore-articles="fr".
    • metadata class="{ ignoreArticles : 'fr' }". This requires the metadata plugin.
    • headers option headers : { 0 : { ignoreArticles : 'fr' } }.
    • header class name class="ignoreArticles-fr".

  • In v2.17.8, you can set up a string to ignore, e.g. keep a title intact like "A to Z", as follows:
    • jQuery data data-ignore-articles-except="a to".
    • metadata class="{ ignoreArticlesExcept : 'a to' }". This requires the metadata plugin.
    • headers option headers : { 0 : { ignoreArticlesExcept : 'a to' } }.
  • To add more than one title to ignore, separate them using a vertical bar (shift+\)
    headers: {
      0: {
        ignoreArticles : 'en',
        // no special parsing for titles like "A to Z" or "A B C" or "A One"
        ignoreArticlesExcept : 'a to|a b |a one'
      }
    }
    Note If your title needs a space (e.g. "A B C") make sure it isn't at the end of the ignoreArticlesExcept string; spaces on either end get stripped away.

Customizing

  • To add a custom language to the parser, use the following code:
    $.extend( $.tablesorter.ignoreArticles, {
      "xx" : "a, l'_, de la"
    });
    
    $('table').tablesorter({
      headers: {
        2: {
          sorter: 'ignoreArticles',
          ignoreArticles : 'xx',
          ignoreArticlesExcept : 'a to'
        }
      }
    });
    • where xx is the ignoreArticles id (abbreviation for the language)
    • Each leading article must be separated by a comma and will be case-insensitive.
    • Leading articles will only be removed if they are followed by a space; spaces are automatically included when parsed unless the article definition is followed by an underscore. See the l'_ note below.
    • a is an example of a leading article which will be removed. So, "A Fistfull of Dollars" will only parse "Fistfull of Dollars" and will sort with the other words that start with an "F".
    • l'_ includes an underscore (_); this tells the parser to not add a space after the word. So a title like "l'enfant" will parse as "enfant".
    • de la is an example showing that the parser can remove a multiple-word article.
  • Some languages have been included by default. The information below was obtained from this wikipedia page, so if you discover any errors, or if you want to contribute another language, please open an issue.
    $.tablesorter.ignoreArticles = {
      "en" : "the, a, an",
      "de" : "der, die, das, des, dem, den, ein, eine, einer, eines, einem, einen",
      "nl" : "de, het, de, een",
      "es" : "el, la, lo, los, las, un, una, unos, unas",
      "pt" : "o, a, os, as, um, uma, uns, umas",
      "fr" : "le, la, l'_, les, un, une, des",
      "it" : "il, lo, la, l'_, i, gli, le, un', uno, una, un",
      "hu" : "a, az, egy"
    };

Demo


IMDB top 250 movies (3/27/2013)

Rank Rating Title Votes
1.9.2The Shawshank Redemption (1994)941,067
2.9.2The Godfather (1972)673,484
3.9.0The Godfather: Part II (1974)434,176
4.8.9Pulp Fiction (1994)732,799
5.8.9The Good, the Bad and the Ugly (1966)286,482
6.8.912 Angry Men (1957)231,572
7.8.9The Dark Knight (2008)917,028
8.8.9Schindler's List (1993)483,623
9.8.8The Lord of the Rings: The Return of the King (2003)672,581
10.8.8Fight Club (1999)716,995
11.8.8Star Wars: Episode V - The Empire Strikes Back (1980)462,561
12.8.8The Lord of the Rings: The Fellowship of the Ring (2001)697,724
13.8.8One Flew Over the Cuckoo's Nest (1975)393,499
14.8.7Inception (2010)732,630
15.8.7Goodfellas (1990)411,044
16.8.7Star Wars (1977)518,660
17.8.7Seven Samurai (1954)146,754
18.8.7Forrest Gump (1994)617,489
19.8.7The Matrix (1999)679,951
20.8.7The Lord of the Rings: The Two Towers (2002)603,969
21.8.7City of God (2002)308,820
22.8.6Se7en (1995)547,794
23.8.6The Silence of the Lambs (1991)459,251
24.8.6Once Upon a Time in the West (1968)129,773
25.8.6Casablanca (1942)252,435
26.8.6The Usual Suspects (1995)431,028
27.8.6Raiders of the Lost Ark (1981)394,043
28.8.6Rear Window (1954)190,219
29.8.6It's a Wonderful Life (1946)163,164
30.8.6Psycho (1960)239,467
31.8.6Léon: The Professional (1994)399,997
32.8.5Sunset Blvd. (1950)85,756
33.8.5American History X (1998)433,917
34.8.5Memento (2000)495,175
35.8.5Apocalypse Now (1979)276,646
36.8.5Terminator 2: Judgment Day (1991)425,770
37.8.5Saving Private Ryan (1998)482,123
38.8.5Dr. Strangelove or: How I Learned to Stop Worrying and Love the Bomb (1964)226,703
39.8.5City Lights (1931)54,820
40.8.5Alien (1979)319,629
41.8.5Django Unchained (2012)263,202
42.8.5North by Northwest (1959)139,339
43.8.5Spirited Away (2001)211,121
44.8.5Modern Times (1936)69,431
45.8.5Citizen Kane (1941)197,473
46.8.5The Dark Knight Rises (2012)568,024
47.8.5The Shining (1980)333,295
48.8.5Back to the Future (1985)377,606
49.8.4The Pianist (2002)260,234
50.8.4The Departed (2006)478,100
51.8.4Life Is Beautiful (1997)206,585
52.8.4M (1931)62,112
53.8.4Vertigo (1958)145,330
54.8.4American Beauty (1999)495,829
55.8.4Paths of Glory (1957)70,416
56.8.4Taxi Driver (1976)285,135
57.8.4Double Indemnity (1944)59,206
58.8.4Aliens (1986)289,891
59.8.4Toy Story 3 (2010)277,784
60.8.4WALL·E (2008)376,223
61.8.4The Lives of Others (2006)147,553
62.8.4Gladiator (2000)528,198
63.8.4The Green Mile (1999)390,685
64.8.4The Intouchables (2011)164,584
65.8.4A Clockwork Orange (1971)318,549
66.8.4Amélie (2001)314,747
67.8.4The Great Dictator (1940)68,287
68.8.4The Prestige (2006)432,239
69.8.4Lawrence of Arabia (1962)117,981
70.8.4To Kill a Mockingbird (1962)128,498
71.8.4Reservoir Dogs (1992)369,352
72.8.4Das Boot (1981)106,465
73.8.4The Third Man (1949)73,465
74.8.4Requiem for a Dream (2000)336,877
75.8.3Cinema Paradiso (1988)81,418
76.8.3The Treasure of the Sierra Madre (1948)49,807
77.8.3Eternal Sunshine of the Spotless Mind (2004)389,500
78.8.3The Lion King (1994)313,388
79.8.3Once Upon a Time in America (1984)129,414
80.8.3Star Wars: Episode VI - Return of the Jedi (1983)361,397
81.8.3Full Metal Jacket (1987)270,902
82.8.3L.A. Confidential (1997)264,295
83.8.3Chinatown (1974)130,976
84.8.3Braveheart (1995)426,632
85.8.3Oldboy (2003)189,333
86.8.3Monty Python and the Holy Grail (1975)239,427
87.8.3Singin' in the Rain (1952)89,152
88.8.3Some Like It Hot (1959)107,775
89.8.3Metropolis (1927)66,774
90.8.3Amadeus (1984)162,968
91.8.3Bicycle Thieves (1948)50,266
92.8.3Rashomon (1950)61,981
93.8.32001: A Space Odyssey (1968)246,317
94.8.3All About Eve (1950)51,722
95.8.3Unforgiven (1992)169,421
96.8.3The Sting (1973)104,985
97.8.3Indiana Jones and the Last Crusade (1989)298,740
98.8.3The Apartment (1960)62,712
99.8.3Raging Bull (1980)144,339
100.8.3The Bridge on the River Kwai (1957)92,073
101.8.3Witness for the Prosecution (1957)31,562
102.8.3Grave of the Fireflies (1988)65,417
103.8.3Die Hard (1988)349,451
104.8.3Batman Begins (2005)535,306
105.8.3A Separation (2011)79,685
106.8.3Yojimbo (1961)44,988
107.8.3Snatch. (2000)344,587
108.8.3Inglourious Basterds (2009)436,200
109.8.3For a Few Dollars More (1965)83,738
110.8.3Downfall (2004)149,623
111.8.3Pan's Labyrinth (2006)277,965
112.8.2The Great Escape (1963)98,813
113.8.2Mr. Smith Goes to Washington (1939)49,357
114.8.2Up (2009)319,413
115.8.2On the Waterfront (1954)62,092
116.8.2Toy Story (1995)319,895
117.8.2The Elephant Man (1980)98,958
118.8.2The Seventh Seal (1957)66,074
119.8.2Heat (1995)261,142
120.8.2The General (1926)31,115
121.8.2The Maltese Falcon (1941)73,450
122.8.2Blade Runner (1982)293,867
123.8.2Gran Torino (2008)316,184
124.8.2Rebecca (1940)54,605
125.8.2The Kid (1921)30,188
126.8.2Wild Strawberries (1957)36,922
127.8.2Scarface (1983)301,908
128.8.2Fargo (1996)256,474
129.8.2The Big Lebowski (1998)308,325
130.8.2Touch of Evil (1958)47,592
131.8.2Ran (1985)50,064
132.8.2The Deer Hunter (1978)145,262
133.8.2Cool Hand Luke (1967)75,625
134.8.2The Gold Rush (1925)36,715
135.8.1Lock, Stock and Two Smoking Barrels (1998)244,635
136.8.1Sin City (2005)415,871
137.8.1No Country for Old Men (2007)353,912
138.8.1It Happened One Night (1934)38,738
139.8.1Strangers on a Train (1951)56,857
140.8.1The Avengers (2012)475,869
141.8.1Jaws (1975)236,363
142.8.1The Sixth Sense (1999)422,262
143.8.1Platoon (1986)180,937
144.8.1Casino (1995)192,252
145.8.1The Thing (1982)155,679
146.8.1Trainspotting (1996)273,789
147.8.1High Noon (1952)51,097
148.8.1Butch Cassidy and the Sundance Kid (1969)91,992
149.8.1The Wizard of Oz (1939)169,985
150.8.1Hotel Rwanda (2004)161,201
151.8.1Kill Bill: Vol. 1 (2003)419,696
152.8.1Good Will Hunting (1997)312,846
153.8.1Warrior (2011)159,949
154.8.1The Secret in Their Eyes (2009)63,447
155.8.1Annie Hall (1977)112,605
156.8.1Gone with the Wind (1939)133,071
157.8.1Notorious (1946)47,266
158.8.1The Grapes of Wrath (1940)37,590
159.8.1Into the Wild (2007)226,286
160.8.1My Neighbor Totoro (1988)74,354
161.8.1V for Vendetta (2005)445,345
162.8.1Life of Brian (1979)163,492
163.8.1Finding Nemo (2003)351,617
164.8.1How to Train Your Dragon (2010)207,521
165.8.1Dial M for Murder (1954)57,132
166.8.1The King's Speech (2010)247,037
167.8.1There Will Be Blood (2007)224,943
168.8.1Ben-Hur (1959)95,091
169.8.1The Terminator (1984)334,304
170.8.1The Big Sleep (1946)42,449
171.8.1Network (1976)61,922
172.8.1The Night of the Hunter (1955)39,940
173.8.1Million Dollar Baby (2004)267,944
174.8.1Stand by Me (1986)159,982
175.8.1Groundhog Day (1993)250,675
176.8.1Donnie Darko (2001)358,003
177.8.1The Hobbit: An Unexpected Journey (2012)260,350
178.8.1Twelve Monkeys (1995)282,004
179.8.1Dog Day Afternoon (1975)111,658
180.8.1Black Swan (2010)325,866
181.8.1Amores Perros (2000)108,303
182.8.1The 400 Blows (1959)40,671
183.8.1Mary and Max (2009)57,268
184.8.1The Bourne Ultimatum (2007)285,964
185.8.1Life of Pi (2012)156,722
186.8.1Gandhi (1982)96,275
187.8.1Persona (1966)31,689
188.8.0Howl's Moving Castle (2004)104,225
189.8.0The Killing (1956)39,702
190.8.0The Graduate (1967)133,213
191.8.0The Princess Bride (1987)186,593
192.8.0A Beautiful Mind (2001)296,347
193.8.0 (1963)48,845
194.8.0Slumdog Millionaire (2008)373,963
195.8.0The Hustler (1961)38,935
196.8.0Who's Afraid of Virginia Woolf? (1966)33,649
197.8.0La strada (1954)28,752
198.8.0Rocky (1976)193,474
199.8.0The Manchurian Candidate (1962)48,813
200.8.0Anatomy of a Murder (1959)28,092
201.8.0The Artist (2011/I)113,331
202.8.0The Wild Bunch (1969)46,187
203.8.0The Exorcist (1973)188,999
204.8.0Stalag 17 (1953)30,022
205.8.0Rope (1948)57,554
206.8.0The Man Who Shot Liberty Valance (1962)35,292
207.8.0Barry Lyndon (1975)62,239
208.8.0Sleuth (1972)26,820
209.8.0Stalker (1979)38,428
210.8.0Infernal Affairs (2002)57,096
211.8.0In the Name of the Father (1993)54,640
212.8.0The Truman Show (1998)345,615
213.8.0Roman Holiday (1953)55,590
214.8.0Memories of Murder (2003)27,373
215.8.0Pirates of the Caribbean: The Curse of the Black Pearl (2003)457,277
216.8.0District 9 (2009)332,916
217.8.0Monsters, Inc. (2001)277,654
218.8.0A Fistful of Dollars (1964)71,024
219.8.0Ip Man (2008)70,724
220.8.0The Diving Bell and the Butterfly (2007)61,322
221.8.0Ratatouille (2007)274,240
222.8.0Harry Potter and the Deathly Hallows: Part 2 (2011)257,398
223.8.0Star Trek (2009)291,734
224.8.0A Streetcar Named Desire (1951)54,316
225.8.0The Perks of Being a Wallflower (2012)98,357
226.8.0La Haine (1995)54,972
227.8.0Beauty and the Beast (1991)163,508
228.8.0Shutter Island (2010)370,474
229.8.03 Idiots (2009)63,883
230.8.0All Quiet on the Western Front (1930)34,318
231.8.0Rosemary's Baby (1968)91,657
232.8.0Nausicaä of the Valley of the Wind (1984)45,761
233.8.0Rain Man (1988)235,025
234.8.0Harvey (1950)33,525
235.8.0Incendies (2010)29,047
236.8.0Like Stars on Earth (2007)28,610
237.8.0Mystic River (2003)225,582
238.8.0Jurassic Park (1993)290,452
239.8.0Manhattan (1979)68,578
240.8.0Papillon (1973)53,163
241.8.0Spring, Summer, Fall, Winter... and Spring (2003)36,974
242.8.0The Wrestler (2008)187,480
243.8.0Nosferatu (1922)47,665
244.8.0The Help (2011)150,081
245.8.0In the Mood for Love (2000)43,683
246.8.0Big Fish (2003)253,904
247.7.9The Untouchables (1987)146,540
248.7.9Arsenic and Old Lace (1944)41,392
249.7.9Castle in the Sky (1986)47,537
250.7.9Rio Bravo (1959)29,442

Page Header

<!-- tablesorter -->
<link rel="stylesheet" href="../css/theme.blue.css">
<script src="../js/jquery.tablesorter.js"></script>

<!-- load ignore-articles parser -->
<script src="../js/parsers/parser-ignore-articles.js"></script>
<script>
$(function() {

  $('table').tablesorter({
    theme: 'blue',
    widgets: ['zebra'],
    sortList: [[2, 0]],
    headers: {
      2: {
        sorter: 'ignoreArticles',
        ignoreArticles : 'fr',
        ignoreArticlesExcept : ''
      }
    }
  });

});
</script>