Skip to content
Discussion options

You must be logged in to vote

I'd like when pressing the a key to change the style of that row, set all values from all cells to red color [...]

This recent discussion might be helpful. You can apply styles programmatically with rich renderables, but not with CSS as this works at the widget level.

Here's a quick example, though there might be a more efficient way:

from textual.app import App, ComposeResult
from textual.coordinate import Coordinate
from textual.widgets import DataTable, Footer

ROWS = [
    ("lane", "swimmer", "country", "time"),
    (4, "Joseph Schooling", "Singapore", 50.39),
    (2, "Michael Phelps", "United States", 51.14),
    (5, "Chad le Clos", "South Africa", 51.14),
    (6, "László Cseh", "H…

Replies: 1 comment 11 replies

Comment options

You must be logged in to vote
11 replies
@TomJGooding
Comment options

@pawamoy
Comment options

@TomJGooding
Comment options

@pawamoy
Comment options

@chbndrhnns
Comment options

Answer selected by msempere
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants