2 /*jshint onevar: false */
5 wgMonthNames: ['', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
6 wgMonthNamesShort: ['', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
7 wgDefaultDateFormat: 'dmy',
8 wgContentLanguage: 'en'
11 QUnit.module( 'jquery.tablesorter', QUnit.newMwEnvironment( { config: config } ) );
14 * Create an HTML table from an array of row arrays containing text strings.
15 * First row will be header row. No fancy rowspan/colspan stuff.
17 * @param {String[]} header
18 * @param {String[][]} data
21 function tableCreate( header, data ) {
23 $table = $( '<table class="sortable"><thead></thead><tbody></tbody></table>' ),
24 $thead = $table.find( 'thead' ),
25 $tbody = $table.find( 'tbody' ),
28 $.each( header, function ( i, str ) {
29 var $th = $( '<th>' );
30 $th.text( str ).appendTo( $tr );
32 $tr.appendTo( $thead );
34 for ( i = 0; i < data.length; i++ ) {
35 /*jshint loopfunc: true */
37 $.each( data[i], function ( j, str ) {
38 var $td = $( '<td>' );
39 $td.text( str ).appendTo( $tr );
41 $tr.appendTo( $tbody );
47 * Extract text from table.
49 * @param {jQuery} $table
52 function tableExtract( $table ) {
55 $table.find( 'tbody' ).find( 'tr' ).each( function ( i, tr ) {
57 $( tr ).find( 'td,th' ).each( function ( i, td ) {
58 row.push( $( td ).text() );
66 * Run a table test by building a table with the given data,
67 * running some callback on it, then checking the results.
69 * @param {String} msg text to pass on to qunit for the comparison
70 * @param {String[]} header cols to make the table
71 * @param {String[][]} data rows/cols to make the table
72 * @param {String[][]} expected rows/cols to compare against at end
73 * @param {function($table)} callback something to do with the table before we compare
75 function tableTest( msg, header, data, expected, callback ) {
76 QUnit.test( msg, 1, function ( assert ) {
77 var $table = tableCreate( header, data );
79 // Give caller a chance to set up sorting and manipulate the table.
82 // Table sorting is done synchronously; if it ever needs to change back
83 // to asynchronous, we'll need a timeout or a callback here.
84 var extracted = tableExtract( $table );
85 assert.deepEqual( extracted, expected, msg );
90 * Run a table test by building a table with the given HTML,
91 * running some callback on it, then checking the results.
93 * @param {String} msg text to pass on to qunit for the comparison
94 * @param {String} HTML to make the table
95 * @param {String[][]} expected rows/cols to compare against at end
96 * @param {function($table)} callback something to do with the table before we compare
98 function tableTestHTML( msg, html, expected, callback ) {
99 QUnit.test( msg, 1, function ( assert ) {
100 var $table = $( html );
102 // Give caller a chance to set up sorting and manipulate the table.
106 $table.tablesorter();
107 $table.find( '#sortme' ).click();
110 // Table sorting is done synchronously; if it ever needs to change back
111 // to asynchronous, we'll need a timeout or a callback here.
112 var extracted = tableExtract( $table );
113 assert.deepEqual( extracted, expected, msg );
117 function reversed( arr ) {
119 var arr2 = arr.slice( 0 );
126 // Sample data set using planets named and their radius
127 var header = [ 'Planet' , 'Radius (km)'],
128 mercury = [ 'Mercury', '2439.7' ],
129 venus = [ 'Venus' , '6051.8' ],
130 earth = [ 'Earth' , '6371.0' ],
131 mars = [ 'Mars' , '3390.0' ],
132 jupiter = [ 'Jupiter', '69911' ],
133 saturn = [ 'Saturn' , '58232' ];
136 var planets = [mercury, venus, earth, mars, jupiter, saturn];
137 var ascendingName = [earth, jupiter, mars, mercury, saturn, venus];
138 var ascendingRadius = [mercury, mars, venus, earth, saturn, jupiter];
141 'Basic planet table: sorting initially - ascending by name',
145 function ( $table ) {
146 $table.tablesorter( { sortList: [
152 'Basic planet table: sorting initially - descending by radius',
155 reversed( ascendingRadius ),
156 function ( $table ) {
157 $table.tablesorter( { sortList: [
163 'Basic planet table: ascending by name',
167 function ( $table ) {
168 $table.tablesorter();
169 $table.find( '.headerSort:eq(0)' ).click();
173 'Basic planet table: ascending by name a second time',
177 function ( $table ) {
178 $table.tablesorter();
179 $table.find( '.headerSort:eq(0)' ).click();
183 'Basic planet table: descending by name',
186 reversed( ascendingName ),
187 function ( $table ) {
188 $table.tablesorter();
189 $table.find( '.headerSort:eq(0)' ).click().click();
193 'Basic planet table: ascending radius',
197 function ( $table ) {
198 $table.tablesorter();
199 $table.find( '.headerSort:eq(1)' ).click();
203 'Basic planet table: descending radius',
206 reversed( ascendingRadius ),
207 function ( $table ) {
208 $table.tablesorter();
209 $table.find( '.headerSort:eq(1)' ).click().click();
213 // Sample data set to test multiple column sorting
214 header = [ 'column1' , 'column2'];
222 var initial = [a2, b3, a1, a3, b2, b1];
223 var asc = [a1, a2, a3, b1, b2, b3];
224 var descasc = [b1, b2, b3, a1, a2, a3];
227 'Sorting multiple columns by passing sort list',
231 function ( $table ) {
241 'Sorting multiple columns by programmatically triggering sort()',
245 function ( $table ) {
246 $table.tablesorter();
247 $table.data( 'tablesorter' ).sort(
256 'Reset to initial sorting by triggering sort() without any parameters',
260 function ( $table ) {
267 $table.data( 'tablesorter' ).sort(
273 $table.data( 'tablesorter' ).sort();
276 QUnit.test( 'Reset sorting making table appear unsorted', 3, function ( assert ) {
277 var $table = tableCreate( header, initial );
284 $table.data( 'tablesorter' ).sort( [] );
287 $table.find( 'th.headerSortUp' ).length + $table.find( 'th.headerSortDown' ).length,
289 'No sort specific sort classes addign to header cells'
293 $table.find( 'th' ).first().attr( 'title' ),
294 mw.msg( 'sort-ascending' ),
295 'First header cell has default title'
299 $table.find( 'th' ).first().attr( 'title' ),
300 $table.find( 'th' ).last().attr( 'title' ),
301 'Both header cells\' titles match'
305 // Sorting with colspans
306 header = [ 'column1a' , 'column1b', 'column1c', 'column2' ];
308 aaa1 = [ 'A', 'A', 'A', '1' ],
309 aab5 = [ 'A', 'A', 'B', '5' ],
310 abc3 = [ 'A', 'B', 'C', '3' ],
311 bbc2 = [ 'B', 'B', 'C', '2' ],
312 caa4 = [ 'C', 'A', 'A', '4' ];
313 // initial is already declared above
314 initial = [ aab5, aaa1, abc3, bbc2, caa4 ];
315 tableTest( 'Sorting with colspanned headers: spanned column',
318 [ aaa1, aab5, abc3, bbc2, caa4 ],
319 function ( $table ) {
320 // Make colspanned header for test
321 $table.find( 'tr:eq(0) th:eq(1), tr:eq(0) th:eq(2)' ).remove();
322 $table.find( 'tr:eq(0) th:eq(0)' ).prop( 'colspan', '3' );
324 $table.tablesorter();
325 $table.find( '.headerSort:eq(0)' ).click();
328 tableTest( 'Sorting with colspanned headers: subsequent column',
331 [ aaa1, bbc2, abc3, caa4, aab5 ],
332 function ( $table ) {
333 // Make colspanned header for test
334 $table.find( 'tr:eq(0) th:eq(1), tr:eq(0) th:eq(2)' ).remove();
335 $table.find( 'tr:eq(0) th:eq(0)' ).prop( 'colspan', '3' );
337 $table.tablesorter();
338 $table.find( '.headerSort:eq(1)' ).click();
344 'Bug 28775: German-style (dmy) short numeric dates',
347 // German-style dates are day-month-year
355 // Sorted by ascending date
362 function ( $table ) {
363 mw.config.set( 'wgDefaultDateFormat', 'dmy' );
364 mw.config.set( 'wgContentLanguage', 'de' );
366 $table.tablesorter();
367 $table.find( '.headerSort:eq(0)' ).click();
372 'Bug 28775: American-style (mdy) short numeric dates',
375 // American-style dates are month-day-year
383 // Sorted by ascending date
390 function ( $table ) {
391 mw.config.set( 'wgDefaultDateFormat', 'mdy' );
393 $table.tablesorter();
394 $table.find( '.headerSort:eq(0)' ).click();
399 // Some randomly generated fake IPs
410 // Sort order should go octet by octet
422 'Bug 17141: IPv4 address sorting',
426 function ( $table ) {
427 $table.tablesorter();
428 $table.find( '.headerSort:eq(0)' ).click();
432 'Bug 17141: IPv4 address sorting (reverse)',
435 reversed( ipv4Sorted ),
436 function ( $table ) {
437 $table.tablesorter();
438 $table.find( '.headerSort:eq(0)' ).click().click();
443 // Some words with Umlauts
454 var umlautWordsSorted = [
455 // Some words with Umlauts
467 'Accented Characters with custom collation',
471 function ( $table ) {
472 mw.config.set( 'tableSorterCollation', {
479 $table.tablesorter();
480 $table.find( '.headerSort:eq(0)' ).click();
484 QUnit.test( 'Rowspan not exploded on init', 1, function ( assert ) {
485 var $table = tableCreate( header, planets );
487 // Modify the table to have a multiple-row-spanning cell:
488 // - Remove 2nd cell of 4th row, and, 2nd cell or 5th row.
489 $table.find( 'tr:eq(3) td:eq(1), tr:eq(4) td:eq(1)' ).remove();
490 // - Set rowspan for 2nd cell of 3rd row to 3.
491 // This covers the removed cell in the 4th and 5th row.
492 $table.find( 'tr:eq(2) td:eq(1)' ).prop( 'rowspan', '3' );
494 $table.tablesorter();
497 $table.find( 'tr:eq(2) td:eq(1)' ).prop( 'rowspan' ),
499 'Rowspan not exploded'
503 var planetsRowspan = [
504 [ 'Earth', '6051.8' ],
506 [ 'Mars', '6051.8' ],
511 var planetsRowspanII = [ jupiter, mercury, saturn, venus, [ 'Venus', '6371.0' ], [ 'Venus', '3390.0' ] ];
514 'Basic planet table: same value for multiple rows via rowspan',
518 function ( $table ) {
519 // Modify the table to have a multiple-row-spanning cell:
520 // - Remove 2nd cell of 4th row, and, 2nd cell or 5th row.
521 $table.find( 'tr:eq(3) td:eq(1), tr:eq(4) td:eq(1)' ).remove();
522 // - Set rowspan for 2nd cell of 3rd row to 3.
523 // This covers the removed cell in the 4th and 5th row.
524 $table.find( 'tr:eq(2) td:eq(1)' ).prop( 'rowspan', '3' );
526 $table.tablesorter();
527 $table.find( '.headerSort:eq(0)' ).click();
531 'Basic planet table: same value for multiple rows via rowspan (sorting initially)',
535 function ( $table ) {
536 // Modify the table to have a multiple-row-spanning cell:
537 // - Remove 2nd cell of 4th row, and, 2nd cell or 5th row.
538 $table.find( 'tr:eq(3) td:eq(1), tr:eq(4) td:eq(1)' ).remove();
539 // - Set rowspan for 2nd cell of 3rd row to 3.
540 // This covers the removed cell in the 4th and 5th row.
541 $table.find( 'tr:eq(2) td:eq(1)' ).prop( 'rowspan', '3' );
543 $table.tablesorter( { sortList: [
549 'Basic planet table: Same value for multiple rows via rowspan II',
553 function ( $table ) {
554 // Modify the table to have a multiple-row-spanning cell:
555 // - Remove 1st cell of 4th row, and, 1st cell or 5th row.
556 $table.find( 'tr:eq(3) td:eq(0), tr:eq(4) td:eq(0)' ).remove();
557 // - Set rowspan for 1st cell of 3rd row to 3.
558 // This covers the removed cell in the 4th and 5th row.
559 $table.find( 'tr:eq(2) td:eq(0)' ).prop( 'rowspan', '3' );
561 $table.tablesorter();
562 $table.find( '.headerSort:eq(0)' ).click();
566 var complexMDYDates = [
567 // Some words with Umlauts
568 ['January, 19 2010'],
575 var complexMDYSorted = [
579 ['January, 19 2010'],
584 'Complex date parsing I',
588 function ( $table ) {
589 mw.config.set( 'wgDefaultDateFormat', 'mdy' );
591 $table.tablesorter();
592 $table.find( '.headerSort:eq(0)' ).click();
596 var currencyUnsorted = [
606 var currencySorted = [
613 // Comma's sort after dots
614 // Not intentional but test to detect changes
619 'Currency parsing I',
623 function ( $table ) {
624 $table.tablesorter();
625 $table.find( '.headerSort:eq(0)' ).click();
629 var ascendingNameLegacy = ascendingName.slice( 0 );
630 ascendingNameLegacy[4] = ascendingNameLegacy[5];
631 ascendingNameLegacy.pop();
634 'Legacy compat with .sortbottom',
638 function ( $table ) {
639 $table.find( 'tr:last' ).addClass( 'sortbottom' );
640 $table.tablesorter();
641 $table.find( '.headerSort:eq(0)' ).click();
645 QUnit.test( 'Test detection routine', 1, function ( assert ) {
648 '<table class="sortable">' +
649 '<caption>CAPTION</caption>' +
650 '<tr><th>THEAD</th></tr>' +
651 '<tr><td>1</td></tr>' +
652 '<tr class="sortbottom"><td>text</td></tr>' +
655 $table.tablesorter();
656 $table.find( '.headerSort:eq(0)' ).click();
659 $table.data( 'tablesorter' ).config.parsers[0].id,
661 'Correctly detected column content skipping sortbottom'
665 /** FIXME: the diff output is not very readeable. */
666 QUnit.test( 'bug 32047 - caption must be before thead', 1, function ( assert ) {
669 '<table class="sortable">' +
670 '<caption>CAPTION</caption>' +
671 '<tr><th>THEAD</th></tr>' +
672 '<tr><td>A</td></tr>' +
673 '<tr><td>B</td></tr>' +
674 '<tr class="sortbottom"><td>TFOOT</td></tr>' +
677 $table.tablesorter();
680 $table.children().get( 0 ).nodeName,
682 'First element after <thead> must be <caption> (bug 32047)'
686 QUnit.test( 'data-sort-value attribute, when available, should override sorting position', 3, function ( assert ) {
689 // Example 1: All cells except one cell without data-sort-value,
690 // which should be sorted at it's text content value.
692 '<table class="sortable"><thead><tr><th>Data</th></tr></thead>' +
694 '<tr><td>Cheetah</td></tr>' +
695 '<tr><td data-sort-value="Apple">Bird</td></tr>' +
696 '<tr><td data-sort-value="Bananna">Ferret</td></tr>' +
697 '<tr><td data-sort-value="Drupe">Elephant</td></tr>' +
698 '<tr><td data-sort-value="Cherry">Dolphin</td></tr>' +
701 $table.tablesorter().find( '.headerSort:eq(0)' ).click();
704 $table.find( 'tbody > tr' ).each( function ( i, tr ) {
705 $( tr ).find( 'td' ).each( function ( i, td ) {
707 data: $( td ).data( 'sortValue' ),
713 assert.deepEqual( data, [
734 ], 'Order matches expected order (based on data-sort-value attribute values)' );
738 '<table class="sortable"><thead><tr><th>Data</th></tr></thead>' +
740 '<tr><td>D</td></tr>' +
741 '<tr><td data-sort-value="E">A</td></tr>' +
742 '<tr><td>B</td></tr>' +
743 '<tr><td>G</td></tr>' +
744 '<tr><td data-sort-value="F">C</td></tr>' +
747 $table.tablesorter().find( '.headerSort:eq(0)' ).click();
750 $table.find( 'tbody > tr' ).each( function ( i, tr ) {
751 $( tr ).find( 'td' ).each( function ( i, td ) {
753 data: $( td ).data( 'sortValue' ),
759 assert.deepEqual( data, [
780 ], 'Order matches expected order (based on data-sort-value attribute values)' );
782 // Example 3: Test that live changes are used from data-sort-value,
783 // even if they change after the tablesorter is constructed (bug 38152).
785 '<table class="sortable"><thead><tr><th>Data</th></tr></thead>' +
787 '<tr><td>D</td></tr>' +
788 '<tr><td data-sort-value="1">A</td></tr>' +
789 '<tr><td>B</td></tr>' +
790 '<tr><td data-sort-value="2">G</td></tr>' +
791 '<tr><td>C</td></tr>' +
794 // initialize table sorter and sort once
797 .find( '.headerSort:eq(0)' ).click();
799 // Change the sortValue data properties (bug 38152)
801 $table.find( 'td:contains(A)' ).data( 'sortValue', 3 );
803 $table.find( 'td:contains(B)' ).data( 'sortValue', 1 );
804 // - remove data, bring back attribute: 2
805 $table.find( 'td:contains(G)' ).removeData( 'sortValue' );
807 // Now sort again (twice, so it is back at Ascending)
808 $table.find( '.headerSort:eq(0)' ).click();
809 $table.find( '.headerSort:eq(0)' ).click();
812 $table.find( 'tbody > tr' ).each( function ( i, tr ) {
813 $( tr ).find( 'td' ).each( function ( i, td ) {
815 data: $( td ).data( 'sortValue' ),
821 assert.deepEqual( data, [
842 ], 'Order matches expected order, using the current sortValue in $.data()' );
863 tableTest( 'bug 8115: sort numbers with commas (ascending)',
864 ['Numbers'], numbers, numbersAsc,
865 function ( $table ) {
866 $table.tablesorter();
867 $table.find( '.headerSort:eq(0)' ).click();
871 tableTest( 'bug 8115: sort numbers with commas (descending)',
872 ['Numbers'], numbers, reversed( numbersAsc ),
873 function ( $table ) {
874 $table.tablesorter();
875 $table.find( '.headerSort:eq(0)' ).click().click();
878 // TODO add numbers sorting tests for bug 8115 with a different language
880 QUnit.test( 'bug 32888 - Tables inside a tableheader cell', 2, function ( assert ) {
883 '<table class="sortable" id="mw-bug-32888">' +
884 '<tr><th>header<table id="mw-bug-32888-2">' +
885 '<tr><th>1</th><th>2</th></tr>' +
886 '</table></th></tr>' +
887 '<tr><td>A</td></tr>' +
888 '<tr><td>B</td></tr>' +
891 $table.tablesorter();
894 $table.find( '> thead:eq(0) > tr > th.headerSort' ).length,
896 'Child tables inside a headercell should not interfere with sortable headers (bug 32888)'
899 $( '#mw-bug-32888-2' ).find( 'th.headerSort' ).length,
901 'The headers of child tables inside a headercell should not be sortable themselves (bug 32888)'
906 var correctDateSorting1 = [
908 ['05 February 2010'],
912 var correctDateSortingSorted1 = [
919 'Correct date sorting I',
922 correctDateSortingSorted1,
923 function ( $table ) {
924 mw.config.set( 'wgDefaultDateFormat', 'mdy' );
926 $table.tablesorter();
927 $table.find( '.headerSort:eq(0)' ).click();
931 var correctDateSorting2 = [
933 ['February 05 2010'],
937 var correctDateSortingSorted2 = [
944 'Correct date sorting II',
947 correctDateSortingSorted2,
948 function ( $table ) {
949 mw.config.set( 'wgDefaultDateFormat', 'dmy' );
951 $table.tablesorter();
952 $table.find( '.headerSort:eq(0)' ).click();
956 QUnit.test( 'Sorting images using alt text', 1, function ( assert ) {
958 '<table class="sortable">' +
959 '<tr><th>THEAD</th></tr>' +
960 '<tr><td><img alt="2"/></td></tr>' +
961 '<tr><td>1</td></tr>' +
964 $table.tablesorter().find( '.headerSort:eq(0)' ).click();
967 $table.find( 'td' ).first().text(),
969 'Applied correct sorting order'
973 QUnit.test( 'Sorting images using alt text (complex)', 1, function ( assert ) {
975 '<table class="sortable">' +
976 '<tr><th>THEAD</th></tr>' +
977 '<tr><td><img alt="D" />A</td></tr>' +
978 '<tr><td>CC</td></tr>' +
979 '<tr><td><a><img alt="A" /></a>F</tr>' +
980 '<tr><td><img alt="A" /><strong>E</strong></tr>' +
981 '<tr><td><strong><img alt="A" />D</strong></tr>' +
982 '<tr><td><img alt="A" />C</tr>' +
985 $table.tablesorter().find( '.headerSort:eq(0)' ).click();
988 $table.find( 'td' ).text(),
990 'Applied correct sorting order'
994 QUnit.test( 'Sorting images using alt text (with format autodetection)', 1, function ( assert ) {
996 '<table class="sortable">' +
997 '<tr><th>THEAD</th></tr>' +
998 '<tr><td><img alt="1" />7</td></tr>' +
999 '<tr><td>1<img alt="6" /></td></tr>' +
1000 '<tr><td>5</td></tr>' +
1001 '<tr><td>4</td></tr>' +
1004 $table.tablesorter().find( '.headerSort:eq(0)' ).click();
1007 $table.find( 'td' ).text(),
1009 'Applied correct sorting order'
1013 // bug 41889 - exploding rowspans in more complex cases
1015 'Rowspan exploding with row headers',
1016 '<table class="sortable">' +
1017 '<thead><tr><th id="sortme">n</th><th>foo</th><th>bar</th><th>baz</th></tr></thead>' +
1019 '<tr><td>1</td><th rowspan="2">foo</th><td rowspan="2">bar</td><td>baz</td></tr>' +
1020 '<tr><td>2</td><td>baz</td></tr>' +
1023 [ '1', 'foo', 'bar', 'baz' ],
1024 [ '2', 'foo', 'bar', 'baz' ]
1029 'Rowspan exploding with colspanned cells',
1030 '<table class="sortable">' +
1031 '<thead><tr><th id="sortme">n</th><th>foo</th><th>bar</th><th>baz</th></tr></thead>' +
1033 '<tr><td>1</td><td>foo</td><td>bar</td><td rowspan="2">baz</td></tr>' +
1034 '<tr><td>2</td><td colspan="2">foobar</td></tr>' +
1037 [ '1', 'foo', 'bar', 'baz' ],
1038 [ '2', 'foobar', 'baz' ]
1043 'Rowspan exploding with colspanned cells (2)',
1044 '<table class="sortable">' +
1045 '<thead><tr><th id="sortme">n</th><th>foo</th><th>bar</th><th>baz</th><th>quux</th></tr></thead>' +
1047 '<tr><td>1</td><td>foo</td><td>bar</td><td rowspan="2">baz</td><td>quux</td></tr>' +
1048 '<tr><td>2</td><td colspan="2">foobar</td><td>quux</td></tr>' +
1051 [ '1', 'foo', 'bar', 'baz', 'quux' ],
1052 [ '2', 'foobar', 'baz', 'quux' ]
1057 'Rowspan exploding with rightmost rows spanning most',
1058 '<table class="sortable">' +
1059 '<thead><tr><th id="sortme">n</th><th>foo</th><th>bar</th></tr></thead>' +
1061 '<tr><td>1</td><td rowspan="2">foo</td><td rowspan="4">bar</td></tr>' +
1062 '<tr><td>2</td></tr>' +
1063 '<tr><td>3</td><td rowspan="2">foo</td></tr>' +
1064 '<tr><td>4</td></tr>' +
1067 [ '1', 'foo', 'bar' ],
1068 [ '2', 'foo', 'bar' ],
1069 [ '3', 'foo', 'bar' ],
1070 [ '4', 'foo', 'bar' ]
1075 'Rowspan exploding with rightmost rows spanning most (2)',
1076 '<table class="sortable">' +
1077 '<thead><tr><th id="sortme">n</th><th>foo</th><th>bar</th><th>baz</th></tr></thead>' +
1079 '<tr><td>1</td><td rowspan="2">foo</td><td rowspan="4">bar</td><td>baz</td></tr>' +
1080 '<tr><td>2</td><td>baz</td></tr>' +
1081 '<tr><td>3</td><td rowspan="2">foo</td><td>baz</td></tr>' +
1082 '<tr><td>4</td><td>baz</td></tr>' +
1085 [ '1', 'foo', 'bar', 'baz' ],
1086 [ '2', 'foo', 'bar', 'baz' ],
1087 [ '3', 'foo', 'bar', 'baz' ],
1088 [ '4', 'foo', 'bar', 'baz' ]
1093 'Rowspan exploding with row-and-colspanned cells',
1094 '<table class="sortable">' +
1095 '<thead><tr><th id="sortme">n</th><th>foo1</th><th>foo2</th><th>bar</th><th>baz</th></tr></thead>' +
1097 '<tr><td>1</td><td rowspan="2">foo1</td><td rowspan="2">foo2</td><td rowspan="4">bar</td><td>baz</td></tr>' +
1098 '<tr><td>2</td><td>baz</td></tr>' +
1099 '<tr><td>3</td><td colspan="2" rowspan="2">foo</td><td>baz</td></tr>' +
1100 '<tr><td>4</td><td>baz</td></tr>' +
1103 [ '1', 'foo1', 'foo2', 'bar', 'baz' ],
1104 [ '2', 'foo1', 'foo2', 'bar', 'baz' ],
1105 [ '3', 'foo', 'bar', 'baz' ],
1106 [ '4', 'foo', 'bar', 'baz' ]
1111 'Rowspan exploding with uneven rowspan layout',
1112 '<table class="sortable">' +
1113 '<thead><tr><th id="sortme">n</th><th>foo1</th><th>foo2</th><th>foo3</th><th>bar</th><th>baz</th></tr></thead>' +
1115 '<tr><td>1</td><td rowspan="2">foo1</td><td rowspan="2">foo2</td><td rowspan="2">foo3</td><td>bar</td><td>baz</td></tr>' +
1116 '<tr><td>2</td><td rowspan="3">bar</td><td>baz</td></tr>' +
1117 '<tr><td>3</td><td rowspan="2">foo1</td><td rowspan="2">foo2</td><td rowspan="2">foo3</td><td>baz</td></tr>' +
1118 '<tr><td>4</td><td>baz</td></tr>' +
1121 [ '1', 'foo1', 'foo2', 'foo3', 'bar', 'baz' ],
1122 [ '2', 'foo1', 'foo2', 'foo3', 'bar', 'baz' ],
1123 [ '3', 'foo1', 'foo2', 'foo3', 'bar', 'baz' ],
1124 [ '4', 'foo1', 'foo2', 'foo3', 'bar', 'baz' ]
1128 }( jQuery, mediaWiki ) );