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

Centred table headers pushed left when column sortable == true #4271

Open
dev-lep opened this issue May 15, 2024 · 3 comments
Open

Centred table headers pushed left when column sortable == true #4271

dev-lep opened this issue May 15, 2024 · 3 comments
Labels
BUG Something isn't working

Comments

@dev-lep
Copy link

dev-lep commented May 15, 2024

Vuestic-ui version: 1.9.10

Centred table headers pushed left when column sortable == true

When sort icons are added to a column header with thAlign set to 'center', header text is pushed left.

Reproduction

Demo

@dev-lep dev-lep added the BUG Something isn't working label May 15, 2024
@m0ksem
Copy link
Contributor

m0ksem commented May 23, 2024

Hi. Thanks for the report.

How do you expect this to be fixed?
Obviously, it is because header have sort icon on the right - it is extra 14px.
image

You can add padding on the left to compensate this size. Having 10 default padding + 14px to compensate icon size.

      {
 		key: 'SortableHeader',
        label: "Sortable Header",
        thAlign: "center",
        tdAlign: "center",
        thStyle: 'padding-left: 24px',
        sortable: true
      }

or add padding-left in every td, just like if there was an icon.

      {
 		key: 'SortableHeader',
        label: "Sortable Header",
        thAlign: "center",
        tdAlign: "center",
        tdStyle: 'padding-right: 24px',
        sortable: true
      }

We could make sort icons position absolute, but it will cause overflows...

Do you have a solution for this, expect quick fixes I provided?

@dev-lep
Copy link
Author

dev-lep commented May 23, 2024

Hi @m0ksem, thanks for your quick fixes, I will definitely use them. Sorry, I am not advanced in my knowledge enough to supply a solution, but I will set myself a task to look into it and perhaps gain some more experience.

@m0ksem
Copy link
Contributor

m0ksem commented May 24, 2024

Hi @m0ksem, thanks for your quick fixes, I will definitely use them. Sorry, I am not advanced in my knowledge enough to supply a solution, but I will set myself a task to look into it and perhaps gain some more experience.

Let's see if padding-left solution is helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG Something isn't working
Development

No branches or pull requests

2 participants