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

Feature Request: Make addResizeColumns more flexible #203

Open
huntabyte opened this issue Mar 16, 2024 · 1 comment
Open

Feature Request: Make addResizeColumns more flexible #203

huntabyte opened this issue Mar 16, 2024 · 1 comment

Comments

@huntabyte
Copy link

Currently, we're restricting to passing in a number for the initialWidth, minWidth, maxWidth, etc.

It would be incredible if we could just pass a string that could be any acceptable style value or variable.

@lolcabanon
Copy link
Contributor

Yeah, sometimes I'd like 25ch much! Not sure how it would behave while/after resizing, but for initialWidth or minWidth it would be great.

My current "workaround" is to use an enum, it gives easy consistency :

export const CELL_WIDTH = {
  MAX: 280,
  HUGE: 240,
  LARGE: 200,
  MED: 160,
  SMALL: 120,
  SHORT: 80,
  MIN: 40
};

export default CELL_WIDTH;
table.column({
  // ...
  plugins: {
    resize: {
      initialWidth: CELL_WIDTH.LARGE,
      minWidth: CELL_WIDTH.MED
    }
  }
})

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

No branches or pull requests

2 participants