[BUG] Table: Different behavior using `row_styles` vs. styling each row
See original GitHub issueDescribe the bug
There seem to be different behavior using row_styles
compared to do the styling in the add_row
command.
To Reproduce
console = Console()
bg = Style(bgcolor="rgb(120,40,40)")
table1 = Table(box=box.SIMPLE_HEAD, title="table1", row_styles=["none", bg])
table1.add_column("foo")
table1.add_column("bar")
table1.add_row("1", "2")
table1.add_row("3", "4")
console.print(table1)
table2 = Table(box=box.SIMPLE_HEAD, title="table2")
table2.add_column("foo")
table2.add_column("bar")
table2.add_row("1", "2", style="none")
table2.add_row("3", "4", style=bg)
console.print(table2)
Platform Windows 10, Windows terminal, rich 9.2.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
[BUG] Table: Different behavior using `row_styles` vs. styling ...
Describe the bug There seem to be different behavior using row_styles compared to do the styling in the add_row command.
Read more >TableLayoutPanel: Can't get content rows to size correctly
I was struggling a long time with the correct resizing behavior of this object until I found out, that I need to delete...
Read more >Arranging Controls Using a TableLayoutPanel - Microsoft Learn
Setting Row and Column Properties You can set individual properties of rows and columns by using the RowStyles and ColumnStyles collections.
Read more >Excel table not formatting new rows appropriately - Super User
Oddly, some of my tables pass formatting (espec. cell type) to new cells in a column as expected using the same paste method....
Read more >Cell Style Architecture in Windows Forms Grid - Syncfusion
Row Styles. Changes can be done for a particular or range of rows by using the RowStyles property. This property is a GridStyleInfo...
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 FreeTop 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
Top GitHub Comments
Thanks for the hint! I did the following which works fine:
You can set
row_styles
to a list of strings after the Table is constructed. But I agree the style on add_row should probably set it for the whole row. I’ll look in to changing that in a next release.