Skip to content

Reset formatting #278

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

Open
Quasarrs opened this issue Mar 17, 2025 · 1 comment
Open

Reset formatting #278

Quasarrs opened this issue Mar 17, 2025 · 1 comment

Comments

@Quasarrs
Copy link

I encountered a problem with resetting the color of cells.
I did not find a suitable method for this.
In the program, I use a table and constantly rewrite data in it, each time changing the color of the cells depending on the data.

           for i , val in enumerate(self.all_data):
                self.table_clear.highlight_cells(
                    row=i, column=1,
                    bg="",
                    fg="black"
                )
                self.table_clear.highlight_cells(
                    row=i, column=0,
                    bg="",
                    fg="black",
                )

            for i , val in enumerate(self.all_data):
                self.table_clear.highlight_rows(
                    rows=i,
                    bg="red",
                    fg="black", 
                    redraw=True
                )

For now I'm doing it by erasing with the standard default color before formatting.
But I noticed this peculiarity: if you use the highlight_cells() method and after this method go through the highlight_rows() method, the cells are not set to red.
It seems I don't know how to reset the color settings of the created table.

@JonnyNOS
Copy link

this probably is because you highlight the cells with bg=blank and fg=black.
highlighted cells will be shown over highlighted rows/columns. so the cells will be shown as bg=blank and fg=black

you might need to use dehighlight_cells()

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