jQuery tablesorter 2.0 - Using extractors with parsers

# tablesorter

## Using extractors with parsers

### Flexible client-side table sorting

Back to documentation

NOTE!

- The extractor type was added in v2.17.6 and allows you to apply two parsers to a column:
  - In this demo, the last column contains select dropdowns that have "good", "medium" and "bad" options.
  - So there is a need to use a parser to extract content from the selected option within the select and then use the grades parser to give each grade a sortable value.
  - Thanks to TheSin- for adding this functionality!
- The extractor is always used before the parser.
- Individual columns can be modified by adding the following (they all do the same thing), set in order of priority:
  - jQuery data `data-extractor="select"`.
  - metadata `class="{ extractor: 'select'}"`. This requires the metadata plugin.
  - headers option `headers : { 0 : { extractor : 'select' } }`.
  - header class name `class="extractor-select"`.

# Demo

Name | Major | Gender | English | Japanese | Calculus | Overall grades
--- | --- | --- | --- | --- | --- | ---
Student01 | Languages | male | 80 | 70 | 75 |
Student02 | Mathematics | male | 90 | 88 | 100 |
Student03 | Languages | female | 85 | 95 | 80 |
Student04 | Languages | male | 20 | 50 | 65 |
Student05 | Mathematics | female | 70 | 78 | 70 |
Student06 | Mathematics | male | 44 | 65 | 60 |
Student07 | Languages | female | 99 | 92 | 89 |
Student08 | Mathematics | female | 90 | 98 | 90 |
Student09 | Mathematics | male | 55 | 72 | 66 |

# Javascript

# HTML

Next up: Changing the date format ››