如何为某些 table 单元格设置 CSS 样式? (Eclipse RAP 平台)

How to set CSS style for certain table cells? (Eclipse RAP Platform)

如果我创建 CSS class Table-Cell,它将用于所有 table 个单元格。

Table-Cell {
    padding: 5px;
}

如何将第一个 table 列中的单元格的填充设置为 5px,将第二个 table 列中的单元格设置为 10px?如果没有 RowTemplate,我该怎么做?

Table-Cell:nth-child(odd) {
    padding: 5px;
}

Table-Cell:nth-child(even) {
    padding: 10px;
} 

尝试

nth-child

伪类:

table:nth-child(n) { ... }

遗憾的是,这在 RAP 中尚不可行。您可以尝试启用 markup 并包含一些空白字符,如 U+2003 以添加一些填充。

不支持伪class:nth-child,只支持theming reference.

中定义的伪class