Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One-pixel offset in non-fixed rows when multiple tables on same page use scroller widget #1376

Closed
davidjkrause opened this issue Apr 2, 2017 · 7 comments

Comments

@davidjkrause
Copy link

If I have two tables with the same class on a page that are set to use the scroller widget, and activated like this:

$('.player-pitch-table-fixedcols').tablesorter({
widthFixed: true,
theme: 'blackice',
widgets: ['zebra', 'scroller'],
sortInitialOrder: "desc",
widgetOptions: {
scroller_height: 0,
scroller_fixedColumns: 3
},
});

The first table has a missing height in the non-fixed div on a row with class "remove-me", and ends up being offset slightly.

I am able to work around it by adding this line to my CSS:

.tablesorter-scroller-spacer.remove-me { height: 1px; }

But without that forced height, at least the first table on the page will have the non-fixed rows one pixel higher than the fixed rows.

JSFiddle with a demonstration at https://jsfiddle.net/e1waajt1/1/

Very possible that I'm doing something else wrong here - maybe not supposed to use a class selector this way to set the scroller on multiple tables?

@Mottie
Copy link
Owner

Mottie commented Apr 9, 2017

Hi @davidjkrause!

Sorry for not responding earlier. Did the fix in #1382 resolve this issue as well?

@davidjkrause
Copy link
Author

No worries, of course.

The fix for #1382 is applied in https://jsfiddle.net/e1waajt1/3 and the one pixel offset is still there on the first table, but not on the second one. This is consistent across the browsers I've tested, including Chrome on a few platforms and Safari on Mac.

@Mottie
Copy link
Owner

Mottie commented Apr 12, 2017

Sorry for the delay... somehow I can't get the hidden row or cells inside to set to a height of zero. I've tried pretty much everything:

  • line-height: 0;
  • font-size: 0;
  • border-collapse: collapsed;
  • clip: rect(0,0,0,0); (except this requires position: absolute)
  • text-size-adjust: 0%; (saw this one in the properties)

In Chrome, the cell & row height will not go below 1.5px...

If I set box-sizing: content-box; on the cell, it will set the height to zero, but the row remains at 1.5px and messes up the alignment anyway.

Any ideas?

@Mottie
Copy link
Owner

Mottie commented Apr 12, 2017

Anyway, here is an updated demo which uses the scroller widget from the master branch.

@TheSin-
Copy link
Collaborator

TheSin- commented Apr 12, 2017

looks really good on safari, just letting you know.

@TheSin-
Copy link
Collaborator

TheSin- commented Apr 12, 2017

Oh I see it now I was looking at the top, you meant between the 2nd and 3rd visible row, yeah there I see an extra pixel

@Mottie
Copy link
Owner

Mottie commented Apr 12, 2017

Yeah, the row is still taking up space, but at least it's all aligned now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants