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] Applying width to a specific column in a tgb.table does not work #2286

Closed
1 of 7 tasks
AlexandreSajus opened this issue Nov 27, 2024 · 6 comments · Fixed by #2300 or #2358
Closed
1 of 7 tasks

[🐛 BUG] Applying width to a specific column in a tgb.table does not work #2286

AlexandreSajus opened this issue Nov 27, 2024 · 6 comments · Fixed by #2300 or #2358
Assignees
Labels
GUI: Front-End 💥Malfunction Addresses an identified problem. 🟨 Priority: Medium Not blocking but should be addressed 🔒 Staff only Can only be assigned to the Taipy R&D team

Comments

@AlexandreSajus
Copy link
Contributor

AlexandreSajus commented Nov 27, 2024

What went wrong? 🤔

A customer requested for specific columns in his tgb.table to have a bigger width. The column names have spaces in them so using tgb.table(width__column_name="200px") won't work.

This example is supposed to work but applies the style to all columns instead:

from taipy.gui import Gui
import taipy.gui.builder as tgb
import pandas as pd

data = pd.DataFrame({"A C": [1, 2, 3], "B C": [4, 5, 6], "C C": [7, 8, 9]})

properties_table = {"width[B C]": "500px"}

with tgb.Page() as page:
    tgb.table(data="{data}", properties="{properties_table}")

Gui(page=page).run()

image

Acceptance Criteria

  • A unit test reproducing the bug is added.
  • Any new code is covered by a unit tested.
  • Check code coverage is at least 90%.
  • The bug reporter validated the fix.
  • Related issue(s) in taipy-doc are created for documentation and Release Notes are updated.

Code of Conduct

  • I have checked the existing issues.
  • I am willing to work on this issue (optional)
@AlexandreSajus AlexandreSajus added 💥Malfunction Addresses an identified problem. 🟨 Priority: Medium Not blocking but should be addressed GUI: Front-End labels Nov 27, 2024
@FredLL-Avaiga FredLL-Avaiga self-assigned this Nov 28, 2024
@jrobinAV jrobinAV added the 🔒 Staff only Can only be assigned to the Taipy R&D team label Dec 2, 2024
@FredLL-Avaiga FredLL-Avaiga changed the title [🐛 BUG] Applying width to a specific column in a tgb.table does not work [🐛 BUG] Applying width to a specific column (named with spaces) in a tgb.table does not work Dec 3, 2024
@FredLL-Avaiga
Copy link
Member

This issue is not linked to the column name.
the width for the column is propagated to the front-end but it was not noticed due to the way table handle column size requests.

@FredLL-Avaiga
Copy link
Member

A css workaround

with tgb.Page(style={"taipy-table": {"th:nth-child(2)": {"min-width": "500px"}}}) as page:
    tgb.table(data="{data}", properties="{properties_table}")

@FabienLelaquais FabienLelaquais changed the title [🐛 BUG] Applying width to a specific column (named with spaces) in a tgb.table does not work [🐛 BUG] Applying width to a specific column in a tgb.table does not work Dec 16, 2024
FabienLelaquais added a commit that referenced this issue Dec 17, 2024
* Backport to 4.0 of Taipy GUI issues #2212, #2242, #2281, #2286, #2302, and #2305.
* Upgrade JS bundles versions to 4.0.2
@FlorianJacta
Copy link
Member

I believe this is not fixed. I cannot change the width of a single column

@FredLL-Avaiga
Copy link
Member

Is it fixed in develop ?

@FlorianJacta
Copy link
Member

Same thing. It seems like changing the width of one column is changing everything.

If I configure every width for every column, I have a different behavior:

from taipy.gui import Gui
import taipy.gui.builder as tgb
import pandas as pd

data = pd.DataFrame({"A C": [1, 2, 3], "B C": [4, 5, 6], "C C": [7, 8, 9]})

properties_table = {"width[B C]": "50px", "width[A C]": "500px", "width[C C]": "100px"}

with tgb.Page() as page:
    tgb.table(data="{data}", properties="{properties_table}")

Gui(page=page).run()

FredLL-Avaiga pushed a commit that referenced this issue Dec 19, 2024
@FredLL-Avaiga FredLL-Avaiga mentioned this issue Dec 19, 2024
5 tasks
FredLL-Avaiga added a commit that referenced this issue Dec 20, 2024
* table col width
resolves #2286

* Fab's comment

Co-authored-by: Fabien Lelaquais <[email protected]>

* notSortable => sortable

* Fab's comment

Co-authored-by: Fabien Lelaquais <[email protected]>

---------

Co-authored-by: Fred Lefévère-Laoide <[email protected]>
Co-authored-by: Fabien Lelaquais <[email protected]>
@jrobinAV jrobinAV reopened this Dec 20, 2024
@AlexandreSajus
Copy link
Contributor Author

Fixed in 4.0.2.dev2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI: Front-End 💥Malfunction Addresses an identified problem. 🟨 Priority: Medium Not blocking but should be addressed 🔒 Staff only Can only be assigned to the Taipy R&D team
Projects
None yet
4 participants