jquery-datatables icon indicating copy to clipboard operation
jquery-datatables copied to clipboard

More than one datatable per page looks broken

Open Ana06 opened this issue 6 years ago • 3 comments

This is how my second table looks like using responsive:

image

Ana06 avatar Dec 03 '18 11:12 Ana06

hi @Ana06, this issue may related with you css grid or something else.

mkhairi avatar Dec 05 '18 03:12 mkhairi

css grid? I don't think so, because the css is the same for the two tables and only the second one looks broken.

This is where I am using it: https://github.com/openSUSE/open-build-service/blob/master/src/api/app/views/webui2/webui/user/_involvement.html.haml

Ana06 avatar Feb 07 '19 15:02 Ana06

@Ana06, owh just noticed your datatables in bootstrap tabs.
We need to call responsive.recalc() as well so Responsive also knows about the change

$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
      console.log( 'show tab' );
      $($.fn.dataTable.tables(true)).DataTable()
          .columns.adjust()
          .responsive.recalc();
 });

mkhairi avatar Feb 07 '19 23:02 mkhairi