question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Headers are not align with content while scrolling

See original GitHub issue

I have seen similar issues here already but not quite the one that I am experiencing. When I have a table and the page loaded with all the content everything is well aligned, as soon as I start moving the X Scroll the header doesn’t go along with the columns:

All good initially: 11111111

When scrolling: 2222222222222

My javascript: $("#logs_tabulator").tabulator({ height: "500px", pagination: "remote", ajaxURL: '/list', columns:[ {title:"id", field:"id", sorter:"string", width: "5%"}, {title:"date", field:"date", sorter:"string", width: "15%"}, {title:"level", field:"level", sorter:"string", width: "10%"}, {title:"action", field:"action", sorter:"string", width: "10%"}, {title:"entity", field:"entity", sorter:"string", width: "20%"}, {title:"message", field:"message", sorter:"string", width: "30%"}, {title:"user", field:"user", sorter:"string", width: "15%"}, {title:"exception_code", field:"exception_code", sorter:"string", width: "10%"}, {title:"exception_line", field:"exception_line", sorter:"string", width: "10%"}, {title:"exception_file", field:"exception_file", sorter:"string", width: "20%"}, {title:"serialized_entity", field:"serialized_entity", sorter:"string", width: "20%"}, ], });

I am not sure if this is a bug or what… I have tested this on Chrome Version 54.0.2840.99 m (64-bit) and also on Firefox 50.1.0

One thing that I just noticed while writing this is that this only happens if I use the Width property, for the sake of testing I removed the width of all columns and manually expanded all the columns so that the X scroll appeared and when I scrolled then it did not happen.

Any ideas?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
olifolkerdcommented, Dec 14, 2016

It appears to be an issue with percentage widths, i will have a look into it this evening for you

0reactions
bvisonlcommented, Dec 30, 2016

sure:

$("#logs_tabulator").tabulator({
                height: "600px",
                pagination: "remote",
                paginationSize: 20,
                movableCols:true,
                persistentLayout: true,
                persistentLayoutID:"abcdefehijklmn",
                ajaxURL: "/list"
                columns:[
                    {title:"Id", field:"id", sorter:"string", width: "5%"},
                    {title:"Date", field:"date", sorter:"string", width: "15%"},
                    {title:"Level", field:"level", sorter:"string", width: "10%"},
                    {title:"Action", field:"action", sorter:"string", width: "10%"},
                    {title:"Entity", field:"entity", sorter:"string", width: "20%"},
                    {title:"Message", field:"message", sorter:"string", width: "30%"},
                    {title:"User", field:"user", sorter:"string", width: "15%"},
                    {title:"Exception Code", field:"exception_code", sorter:"string", width: "10%"},
                    {title:"Exception Line", field:"exception_line", sorter:"string", width: "10%"},
                    {title:"Exception File", field:"exception_file", sorter:"string", width: "20%"},
                ],
            });
Read more comments on GitHub >

github_iconTop Results From Across the Web

Scrollable Table Body With Fixed Header Columns Not Aligning
Since the header and the body of the table are connected to each other and display: block separates them, you will need to...
Read more >
Scrolling header alignment — DataTables forums
The problem was that when displaying a table with only a few columns, and a row with only some brief test text, the...
Read more >
A table with both a sticky header and a sticky first column
It's pretty easy to make the header of a table stick to the top of the screen while scrolling through a bunch or...
Read more >
CSS - Aligned scrollable table body with fixed header
Realising that I wanted the header to be fixed, I set the height and overflow attributes to the tbody tag, but then I...
Read more >
How to create a table with fixed header and scrollable body
By setting the position property to “sticky” and specifying “0” as a value of the top property for the <th> element. By setting...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found