Replies: 1 comment
-
|
Hi @hub-il, This seems to a be a misconception of how CSS works. Let me post an AI-generated explanation: In CSS, commas split a selector list into completely independent selectors. .status-table th, td { … }means “apply the rules to:
If the intent is to style only the cells inside /* Correctly scoped */
.status-table th,
.status-table td {
/* styles */
}A slightly shorter, equivalent form is: .status-table :is(th, td) {
/* styles */
}(Use If you also want different rules for header vs body cells, be explicit: .status-table thead th { /* header styles */ }
.status-table tbody td { /* body styles */ }Tip: if you saw unexpected styles “leaking” to other tables, it’s because |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Example Code
Description
I am trying to style two tables on the same page differently. One in a dialog and the other in the content area. I am using the suggested way to style tables as suggested in #885.
When I combine the styles for the table header and table cell using
th, tdI get inconsistent results in what gets styled. If I sperate the style forthandtdin separate styles then the styles appear to get applied as expected.TLDR: having two tables where
thandtdare styled together (e.g.,.status-table th, td {}) results in inconsistent application of the rules.NiceGUI Version
3.2
Python Version
3.13
Browser
Edge
Operating System
Linux
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions