[REQUEST] prevent expansion of certain columns
See original GitHub issueI’d like to be able to expand certain columns and keep others at a fixed width. This is possible right by now by setting expand=True
on the table and setting ratio=1
(?) in the columns that can be expanded (see this discussion):
from rich.table import Table
from rich.text import Text
from rich import print
t = Table(box=None, padding=0, expand=True)
t.add_column(Text("x", justify="left"), justify="right", ratio=1)
t.add_column(Text("y", justify="left"), justify="right")
t.add_row("12", "12")
t.add_row("1234", "1234")
print(t)
x y
12 12
12341234
This is a little weird. A better API would be to have an expand
attribute in each column that overrides the table’s expand
.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6
Top Results From Across the Web
How to prevent item height expansion from expanding other ...
I'm trying to make a 3x3 grid with items that can be expanded and collapsed. When the user clicks on an item that...
Read more >Optimize Power Query when expanding table columns
When expanding related rows from one table to another, the default behavior of Power BI is to generate a call to Table.ExpandTableColumn ....
Read more >How to hide columns in Excel using shortcut, VBA or grouping
4 quick ways to hide and show columns in Excel: shortcut, ribbon menu, VBA, and grouping.
Read more >Lock or Unlock Columns and Rows
To lock a column, right-click the column header and click Lock Column. Lock Column Menu · To lock a row, right-click a row...
Read more >Column Permissions - monday.com Support
This is especially helpful if you have some sensitive information you don't want some users to see or change. How to restrict column...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The default is to fit the content, which means the column width can’t grow beyond the widest cell. It will only grow if you assign a proportion of the excess space via
ratio
.Setting expand on the Table expands the table width, but it will still try to respect the existing column rules.
Did I solve your problem?
Why not buy the devs a coffee to say thanks?