Widget:DisplayTable

 /* <![CDATA[ */ $(function { var page = decodeURI(""),      table = "".replace(/[^-_a-zA-Z0-9]/g, ),      columns = "",      rows = "",      displayTable = "#weDisplayTable" + ,      cNames = [];

// return a 1 indexed column number or null function cNumber(s) { var i, l;   s = $.trim(s.toLowerCase); if (/\d/.test(s)) { return parseInt(s, 10); } else { l = cNames.length; for (i=0; i -1) { return i+1; }     }    }    return null; } $(displayTable).load('/' + encodeURI(page) + ' #' + table, function {    var $table, $sortableTables,    	need1 = false;    $table = $(displayTable).find('table');    $table.removeAttr('id');    if (columns.length) {      $(displayTable).find('tr th').each(function { cNames.push($.trim($(this).text.toLowerCase)); });     $(displayTable).find('td,th').hide;      $.each(columns.split(';'), function(i, v){ var c = cNumber(v); if (c !== null) { $(displayTable + ' td:nth-child(' + c + '),th:nth-child(' + c + ')').show; // remember if we need column 1 need1 = need1 || (c === 1); }     });      if (!need1) {        setTimeout(function { $(displayTable + ' th:nth-child(1)').hide; }, 1000);     }    }    if (rows.length) {      $(displayTable).find('tr').hide;      $(displayTable).find('tr>th').parent.show;      rows = rows.split(';');      $.each(rows, function(i, v) { var parts = v.toLowerCase.split('~', 2), col, value, cell; if (parts.length === 2) { col = cNumber(parts[0]); value = $.trim(parts[1]); if (col >= 1) { col = col - 1; $(displayTable).find('tr').each(function {             cell = $(this).find('td').eq(col).text.toLowerCase;              if (cell.indexOf(value) > -1) {                $(this).show;              }            }); }       }      });    }    $sortableTables = $('#content table.sortable');    if ( $sortableTables.length ) {		mw.loader.using('jquery.tablesorter', function  { // asynchronously loaded tablesorter doesn't check if someone else has already made it sortable setTimeout(function {				$sortableTables.each(function { if (!$(this).hasClass('jquery-tablesorter')) { $(this).tablesorter; }				});			}, 1001);       });    }  }); }); /* ]]> */

This widget allows the AJAX inclusion of a table with a specified ID from a particular page. Individual columns and rows can be displayed, while the others are hidden.

Parameters

 * page:the name of the page in the wiki containing the original table
 * tableid:the HTML id of the table
 * columns: a semicolon separated list of columns to be shown
 * if parameter is numeric, it is used as 1 indexed column number
 * otherwise, it is used as a case insensitive substring, and the first column heading that it matches wins


 * rows:a semicolon separated list of conditions which will cause a row to be shown, currently the only condition implemented is columnNumber~substring
 * minheight:the minimum height of the table display, including CSS units, such as 120px or 10ex. Setting this to the approximate table size minimizes the perceived redrawing when the table is inserted on the page. You can use a browser's developer tools inspect feature to estimate the size. (optional, default: 100px)