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

Table - allow users to change column width #7894

Closed
2 of 4 tasks
ian13262 opened this issue Sep 28, 2023 · 5 comments
Closed
2 of 4 tasks

Table - allow users to change column width #7894

ian13262 opened this issue Sep 28, 2023 · 5 comments
Labels
0 - new New issues that need assignment. ArcGIS Online Issues logged by ArcGIS Online team members. c-table Issues that pertain to the calcite-table and related components calcite-components Issues specific to the @esri/calcite-components package. enhancement Issues tied to a new feature or request. estimate - 3 A day or two of work, likely requires updates to tests. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. p - medium Issue is non core or affecting less that 60% of people using the library

Comments

@ian13262
Copy link

ian13262 commented Sep 28, 2023

Check existing issues

Description

calcite-tables should allow users to adjust the widths of columns to most optimally display header/cell content. This would be similar to how tables in Google Docs/Microsoft Word/etc. allow for dynamic sizing.

Acceptance Criteria

Being able to adjust column widths manually in a calcite-table would allow users to tweak their tables' design based on changing content/word lengths in columns.

Relevant Info

No response

Which Component

calcite-table

Example Use Case

We want to avoid something like this from happening in smart mapping raster panels: https://codepen.io/iyouth66/pen/ExGLqjX?editors=100. If a word in a calcite-table-cell is too long, the table will exceed any set max-width. We can prevent this by using overflow-wrap, but then the table will shrink the other columns unnecessarily. It would be more ideal if we could adjust the column widths manually to fit everything as desired.

image

Priority impact

p3 - want for upcoming milestone

Calcite package

  • @esri/calcite-components
  • @esri/calcite-components-react
  • @esri/eslint-plugin-calcite-components

Esri team

ArcGIS Online

@ian13262 ian13262 added 0 - new New issues that need assignment. enhancement Issues tied to a new feature or request. needs triage Planning workflow - pending design/dev review. labels Sep 28, 2023
@github-actions github-actions bot added calcite-components Issues specific to the @esri/calcite-components package. ArcGIS Online Issues logged by ArcGIS Online team members. p3 - want for upcoming milestone labels Sep 28, 2023
@macandcheese macandcheese added the c-table Issues that pertain to the calcite-table and related components label Dec 16, 2023
@macandcheese
Copy link
Contributor

Implementation note: this is a dev-user story, to adjust and set a static width for a column. It is separate from the end-user story to, as a user, drag and adjust the width of the column.

@jfelicianiats
Copy link

@macandcheese I would also like the ability to set a static width for columns via the table headers and table items that gets applied to the or . Not sure if this is the correct place to put this, but both independent features would be nice. Is there a ticket I can follow to track progress on this?

@macandcheese
Copy link
Contributor

macandcheese commented Mar 7, 2024

Hi @jfelicianiats this would be the issue to track for progress updates for this specific feature.

As a workaround, you can set a defined width on elements inside the Table Cell, which will constrain the column width. Note, this won't work in layout="fixed", and for exact width, you can adjust for the padding of a Table Cell in a given scale: https://codepen.io/mac_and_cheese/pen/LYqmvzY?editors=1000

@jfelicianiats
Copy link

@macandcheese Thanks for the update. As a side note the proposed workaround doesn't work in all cases. If you set a specific width on table cell content, it has a limit to how small the column will become. The use case I need it for is where the column is just a short abbreviation I need to make a small pixel width so its not obtrusively large. In your example, the table column for "Date / Time" won't shrink beyond roughly 130px.

@geospatialem geospatialem added impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone and removed p3 - want for upcoming milestone labels May 21, 2024
@geospatialem geospatialem added p - medium Issue is non core or affecting less that 60% of people using the library estimate - 3 A day or two of work, likely requires updates to tests. needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. and removed needs triage Planning workflow - pending design/dev review. labels Jun 25, 2024
@geospatialem
Copy link
Member

geospatialem commented Jul 1, 2024

The request above is now achievable in 2.10.1, and Adam provided a use case example for defining custom column widths above via https://codepen.io/mac_and_cheese/pen/LYqmvzY. Closing out the above.

There will also be future work on an advanced table that will have more flexibility, targeted for late 2025: #6646

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - new New issues that need assignment. ArcGIS Online Issues logged by ArcGIS Online team members. c-table Issues that pertain to the calcite-table and related components calcite-components Issues specific to the @esri/calcite-components package. enhancement Issues tied to a new feature or request. estimate - 3 A day or two of work, likely requires updates to tests. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. p - medium Issue is non core or affecting less that 60% of people using the library
Projects
None yet
Development

No branches or pull requests

4 participants