GWT FlexTable标题栏

时间:2011-12-18 19:07:42

标签: css gwt

我对Table周围的各种元素有CSS定义,如下所示(省略了详细信息,仅供参考的样式名称)。

table.entities {
border: 1px solid #c5d7ef;
border-collapse: collapse;
width: 100%;
margin-bottom: 0;
}

table.entities th, table.entities td {
padding: .25em 1.5em .5em .5em;
}
table.entities th {
  font-weight: bold;
  text-align: left;
  background: #e5ecf9;
  white-space: nowrap;
}

table.entities th a, table.entities th a:visited {
  color: black;
  text-decoration: none;
}

table.entities td {
  background-color: #fff;
  text-align: left;
  vertical-align: top;
  cursor: pointer;
}

table.entities tr.even td {
  background-color: #f9f9f9;
}

table.entities { border: 1px solid #c5d7ef; border-collapse: collapse; width: 100%; margin-bottom: 0; } table.entities th, table.entities td { padding: .25em 1.5em .5em .5em; } table.entities th { font-weight: bold; text-align: left; background: #e5ecf9; white-space: nowrap; } table.entities th a, table.entities th a:visited { color: black; text-decoration: none; } table.entities td { background-color: #fff; text-align: left; vertical-align: top; cursor: pointer; } table.entities tr.even td { background-color: #f9f9f9; } 我将样式应用于偶数行:

但由于某种原因,标题样式不适用于表格。这是我试过的

  • 因为我希望flexTable.getRowFormatter().getElement(row).setClassName("even"); 将样式应用于第一行,但不确定这是否是一个有效的假设
  • 将标题样式从th更改为类似th的内容,然后使用第一行的行格式化程序明确地应用于第一行。我试过第一行的值为1& 0两者都没有给我结果

任何人都可以帮我发现我可能出错的地方吗?

1 个答案:

答案 0 :(得分:3)

我很确定FlexTable不会呈现<th>标记。一切都包含在<tbody>中。

您还必须记住,<tr>标记非常不合适,因此要为整个行添加样式,以便将相同的样式应用于所有子<td>标记。

tr.someStyle td {
  /* all styles that apply to the row */
}

如果您发布实际样式和未应用的内容,我们可以提供更多帮助。

相关问题