cssdatatablestaipy

Column cell styling in Taipy's tables


Impressed by your high-potential framework, real next-gen for its simplicity

I have some problems with cell styling in tables, namely in columns.

For a model example:

data = pd.DataFrame(
{“Name”:[“John”,”Mary”,”Bob”],
“Age”:[32,23,40]
}
)

page = “””
<|{data}|table|style[Name]={lambda state, value: “red-cell”}|>
“””

It throws no errors or warnings but no coloring is displayed

The corresponding CSS:

.red-cell td {
background-color: red;
}

At the same time, for row styling, it’s ok, for example:

<|{data}|table|style={lambda state, idx: “red-cell”}|>

What can be wrong with my column example?

Thanks,


Solution

  • The 'td' is not needed when styling a specific column. Delete it, and this should work properly.

    .red-cell {
    background-color: red;
    }