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

[Bug Report] data table headers are not vertically aligned under different sizes #10164

Closed
craigbroadbear opened this issue Jan 9, 2020 · 6 comments
Labels
C: VDataTable VDatatable help wanted We are looking for community help T: bug Functionality that does not work as intended/expected

Comments

@craigbroadbear
Copy link

Environment

Vuetify Version: 2.2.3
Vue Version: 2.6.11
Browsers: Chrome 79.0.3945.88
OS: Windows 10

Steps to reproduce

Ignore codepen link, to reproduce go to https://vuetifyjs.com/en/components/data-tables

Slowly resize your browser width from full screen to small - you will notice at some point some of the headers are aligned high, some low.

e.g. https://www.screencast.com/t/P2NbdnTU0A6

It can look very messy when you have lots of columns, with some up and some down. e.g. up, down, up up down down up. This is what happens to me most of the time with my tables, its not a one off resize thing like the example I gave.

Expected Behavior

All the headers should be vertically aligned.

Actual Behavior

Headers are not vertically aligned.

Reproduction Link

https://codepen.io/

@ghost ghost added the S: triage label Jan 9, 2020
@craigbroadbear
Copy link
Author

Setting a global style of:
th {
vertical-align: top;
}
fixes the issue for me.

@jacekkarczmarczyk
Copy link
Member

The problem is that sort icon is moved below the header text if it doesn't fit:

image

@jacekkarczmarczyk jacekkarczmarczyk added T: bug Functionality that does not work as intended/expected and removed S: triage labels Jan 11, 2020
@sushi2all
Copy link

Also have this issue. This is aggravated if some headers are left aligned and others right aligned. In right-aligned headers the arrow moves at the top, so in a given table the actual header can be on three different heights:
image

In my case the following in my global css worked:

.v-data-table-header th {
  white-space: nowrap;
}

@IsabelMeraner
Copy link

In my case the following in my global css worked:

.v-data-table-header th {
  white-space: nowrap;
}

this worked for me...
If the screensize is too small, vuetify simply adds a scroll bar in order to view all table headers.

@AnhHoangQuach
Copy link

AnhHoangQuach commented Dec 3, 2021

Also have this issue. This is aggravated if some headers are left aligned and others right aligned. In right-aligned headers the arrow moves at the top, so in a given table the actual header can be on three different heights: image

In my case the following in my global css worked:

.v-data-table-header th {
  white-space: nowrap;
}

this worked for me but if not working use need to use ::v-need before

@ITJoePC
Copy link

ITJoePC commented Jun 28, 2023

This worked in Vuetify 3:

.v-table thead th span {
  white-space: nowrap;
}

Please share if there's a "Vuetify" way to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VDataTable VDatatable help wanted We are looking for community help T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

No branches or pull requests

7 participants