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

[MdTable] fixed header does not align header with table content #1810

Closed
williamleven opened this issue Jun 8, 2018 · 5 comments
Closed
Labels

Comments

@williamleven
Copy link

Steps to reproduce

  1. Create a table with fixed header
  2. Add a search field for the table
  3. Fill table with input of different lenghts
  4. Search on something that only makes the shorter entries stay.

You can also see that the table header content doesn't align to start with ether.

After a window resize it does however align properly.

Which browser/system?

vue-material: 1.0.0-beta-10.2
Vue: 2.5.16
Browser: Opera 53.0.2907.37
OS: Arch Linux (x86_64; /usr/bin/i3)

What is expected?

The table header content should align with the table content as it does when you resize the window

What is actually happening?

The table header content does not re align at all

Reproduction Link

https://codesandbox.io/s/p7n7xjjr3j?module=App.vue

Temporary fix

Create a watcher on your table data that calls mdTable's setWidth method whenever the data changes.

@Samuell1 Samuell1 added the bug label Jun 11, 2018
@Samuell1
Copy link
Member

I think this will be hard to solve because it split ups the table to content and header to separate divs.

@Samuell1 Samuell1 changed the title Table with fixed header does not align header with table content [MdTable] fixed header does not align header with table content Jun 11, 2018
@williamleven
Copy link
Author

Wouldn't an easy fix be to apply the temporary fix within the component?

Create a watcher on your table data that calls mdTable's setWidth method whenever the data changes.

If I understand the code correctly in MdTable.vue one would be able to add something like this:

watch: {
  value () {
    this.setWidth()
  }
}

@mingweiLIU
Copy link

Hi, I am using MdTable with fixed-header while still counter the problem: header is not align with table content, the sample code is here:https://codesandbox.io/s/vue-template-3iq42?fontsize=14 and it looks like this:
error

@SashaGeremia
Copy link

Has this issue been resolved?

@mattratliff
Copy link

mattratliff commented Jun 4, 2020

No I don't believe so. I'm still seeing the issue. Samuel1 added a code fix which was merged into dev, but this needs to get added into master for a release.

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

No branches or pull requests

5 participants