DataTables + Bootstrap 3 enabling horizontal scrolling creates a bug

DataTables + Bootstrap 3 enabling horizontal scrolling creates a bug

forsakendollforsakendoll Posts: 11Questions: 0Answers: 0
edited April 2014 in Bug reports
Hi,

I'm having a problem with DataTables integrated with Bootstrap 3 and horizontal scrolling is enabled

Here is my fiddle ( http://jsfiddle.net/ )

I don't know why the header is not aligned with the body of the table. I tried the solution on previous post with same issue. But It still doesn't work for me.

Replies

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    Your jsfiddle link is missing a reference.
  • forsakendollforsakendoll Posts: 11Questions: 0Answers: 0
    Sorry forgot to save the fiddle

    Here it is again ( http://jsfiddle.net/Drefj/ )
  • allanallan Posts: 63,691Questions: 1Answers: 10,500 Site admin
    With DataTables 1.10 and the latest integration files all appears good: http://jsfiddle.net/Drefj/33/

    See: http://next.datatables.net/manual/styling/bootstrap

    Allan
  • protectaprotecta Posts: 3Questions: 1Answers: 0
    edited August 2014

    Up.

    Hello guys,
    I've the same problem, my table is included in a bootstrap 3 modal, the headers are fixed, the vertical and horizontals scrolls work, but headers and data columns are not aligned at all : when I scroll from left to right, the last colum may have the cell value of 3 columns to the left...

    My js :

    $('.fixed_header').DataTable({
                        "paging":false,
                        "scrollY": 400,
                        "scrollX": true,
                        "info": false,
                        "ordering": false,
                        "searching": false
                    });
    

    Link : http://image.noelshack.com/fichiers/2014/32/1407249434-bug-datatables.jpg
    You see at the top right the last column, while you can still use the horizontal scroll at the bottom.. The bottom scroll should be only left-scrollable, but as nothing is aligned, the last 3 columns data can be in the last column by right-scrolling..

    I use the latest version of datatables and bootstrap.

    Sorry for my bad English.

    [edit] : When using ColVis, unchecking a column, and checking it again, everything gets aligned. O.O. I checked the page with firefug. When i did not use ColVis yet, all headers have a width of 0 px; When i uncheck and check a column in ColVis, each header has a width > 0px. Is there a way to simulate the calculation of each element ?

This discussion has been closed.