MediaWiki:Gadget-tbody-scroll.js

$('.tbody-scroll').each(function {

// sync the column widths var rows = $(this).find('tr'); var columns = rows.first.children; var col_width = columns.map(function {       return $(this).width;    }).get; rows.each(function {       $(this).children.each(function(i, el) { $(el).width(col_width[i]); });   });

var emulate_thead = function(table) { var rows = table.find('> tbody > tr'); var thead = $(' '); rows.each(function {           if ($(this).children('td').length > 0) {                return false;            }            thead.append(this);        }); table.prepend(thead); return thead; }

var tbody = $(this).find('tbody').first; var thead = $(this).find('thead').first; if (thead.length == 0) { thead = emulate_thead($(this)); }   var height = $(window).height - thead.height;

$(this).addClass('tbody-scroll-impl'); tbody.css('max-height', height); });