koalyptus / TableFilter

A Javascript library making HTML tables filterable and a bit more :)
https://www.tablefilter.com
MIT License
324 stars 94 forks source link

Sticky headers : can the filter row be included as well as the title row? #677

Closed cjohnsonuk closed 5 years ago

cjohnsonuk commented 5 years ago

My header (in the thead) includes both the column titles and the filter boxes/drop downs. When I have no setting for

filters_cell_tag:

the column titles lock to the top of the screen When I have filters_cell_tag: 'th'

the filters row appears in the same style.

However the filter row now locks to the top of the screen and the column headers disappear (not sure if it goes off the top or if it goes behind the filter row.

On your demo page http://www.tablefilter.com/sticky-headers-overrides.html I added the filters_cell_tag: 'th' using inspect running the following in the console:

tf.destroy(); var tfConfig = { base_path: 'tablefilter/', sticky_headers: true, filters_cell_tag:'th', col_widths: [ "180px", "120px", "120px", null, null, null, null, null, null ], alternate_rows: true, rows_counter: true, btn_reset: true, status_bar: true, col_0: 'multiple', col_1: 'select', col_2: 'checklist' }; var tf = new TableFilter('demo', tfConfig); tf.init();

the demo has the filters row above the columns headers. On scrolling down filters row locks to the top of the screen then the column headers continue scrolling up over the filters until they reach the top where they stop but obscure the top row of the filters row.

Can this be fixed to display both rows when both are th?

running v 0.6.76

koalyptus commented 5 years ago

@cjohnsonuk this can be solved with CSS as per this example: https://codepen.io/koalyptus/pen/ErwvRW

Cheers