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

alignChar CSS changes table row height #1713

Closed
jcwren opened this issue Feb 26, 2020 · 3 comments
Closed

alignChar CSS changes table row height #1713

jcwren opened this issue Feb 26, 2020 · 3 comments

Comments

@jcwren
Copy link

jcwren commented Feb 26, 2020

I had a table that was configured exactly as I want it (first image). When I added the Align Character Widget, it did indeed align the SNR column on the decimal point as desired, but it added space to the bottom of the row (second image). I'm no CSS expert (by a long shot!) and even after poking at this for a couple hours, I can't figure out how to get the rows back to the original height.

In my experiments, I found that commenting out the display: inline-block in the .ts-align-wrap, .ts-align-left, .ts-align-right CSS would get the rows back to the correct height, but (not surprisingly) the decimals were no longer aligned.

This is under Chrome Version 80.0.3987.116 (Official Build) (64-bit). It does the same thing on the Mac verson. Can someone provide advice on how to correct this (if it's CSS related, please use simple words :) ).

This is the HTML from one of the SNR column entries.

<td>
  <span class="ts-align-wrap">
    <span class="ts-align-left" style="min-width:60%">10</span>
    <span class="ts-align-right" style="min-width:40%">
      <i>.</i>
      2
    </span>
  </span>
</td>

image
image

@Mottie
Copy link
Owner

Mottie commented Feb 27, 2020

Hi @jcwren!

Remove the .ts-align-wrap selector from this CSS definition:

.ts-align-wrap,
.ts-align-left,
.ts-align-right {
  display: inline-block;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

I think having the wrapper set to inline-block is causing the shift in height.

@jcwren
Copy link
Author

jcwren commented Feb 27, 2020

Eliminating it completely fixed the row spacing, but broke the alignment. Poking at it a little more, it seems that removing the overflow: hidden; is what fixes the row spacing and keeps the columns aligned. There's probably some implication if the column did overflow, but that will never happen in this case.

/*
**  CSS for tablesorter
*/
.ts-align-wrap {
  white-space: nowrap;
  width: 100%;
  /*
  overflow: hidden;
  */
}
.ts-align-wrap, .ts-align-left, .ts-align-right {
  display: inline-block;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
.ts-align-left {
  text-align: right;
}
.ts-align-right {
  text-align: left;
}

Mottie added a commit that referenced this issue Mar 3, 2020
@Mottie
Copy link
Owner

Mottie commented Mar 3, 2020

Demo has been updated! Thanks!

@Mottie Mottie closed this as completed Mar 3, 2020
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

2 participants