mw.widgets.CheckMatrixWidget = function MWWCheckMatrixWidget( config ) {
var $headRow = $( '<tr>' ),
$table = $( '<table>' ),
+ $thead = $( '<thead>' ),
+ $tbody = $( '<tbody>' ),
widget = this;
config = config || {};
$.each( this.columns, function ( columnLabel ) {
$headRow.append( $( '<td>' ).html( columnLabel ) );
} );
- $table.append( $headRow );
+ $thead.append( $headRow );
// Build table
// eslint-disable-next-line no-restricted-properties
$row.append( $( '<td>' ).append( checkbox.$element ) );
} );
- $table.append( $row );
+ $tbody.append( $row );
} );
+ $table
+ .addClass( 'mw-htmlform-matrix mw-widget-checkMatrixWidget-matrix' )
+ .append( $thead, $tbody );
this.$element
.addClass( 'mw-widget-checkMatrixWidget' )