- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在努力实现这个 Scrollable table在 tr:table(特立尼达)
我在下面尝试过这些,这是我的 xhmtl 页面,其中我有一个数据表,需要按照上面的链接所述进行滚动
<tr:table width="100%" value="#{someBean.exampleList}" var="row" styleClass="scrollTable">
<tr:column >
<f:facet name="header">
<tr:outputText value="Acc num"/>
</f:facet>
<tr:outputText value="#{row.searchAcctNum}"/>
</tr:column>
<tr:column>
<f:facet name="header">
<tr:outputText value="Acc Country"/>
</f:facet>
<tr:outputText value="#{row.pymtCountryCde}"/>
</tr:column>
<tr:column>
<f:facet name="header">
<tr:outputText value="Acc Key"/>
</f:facet>
<tr:outputText value="#{row.custKey}"/>
</tr:column>
<tr:column>
<f:facet name="header">
<tr:outputText value="Acc Port"/>
</f:facet>
<tr:outputText value="#{row.port}"/>
</tr:column>
</tr:table>
然后这就是我的 css 文件中的内容
.scrollTable af:table {
border-spacing: 0;
border: 2px solid black;
}
.scrollTable af|table::content {
border-top: 2px solid black;
line-height: 30px;
height:50px;
overflow-y: auto;
overflow-x: hidden;
}
.scrollTable af|column::header-text{
display: block;
height: 30px;
}
我猜问题出在上面的 CSS 中。因为它提到了 thead、tbody、td、tr 的 css 属性,但是查看 trinidad skins我只能找到这三个类名(af|column::header-text,af|table::content,af|table)作为那个 fiddle 中提到的类名。请让我知道出了什么问题?或者有人可以帮我在 Trinidad 表中为以下 HTML CSS 属性找到正确的 CSS 属性吗?
table.scroll {
/* width: 100%; */ /* Optional */
/* border-collapse: collapse; */
border-spacing: 0;
border: 2px solid black;
}
table.scroll tbody,
table.scroll thead { display: block; }
thead tr th {
height: 30px;
line-height: 30px;
/* text-align: left; */
}
table.scroll tbody {
height: 100px;
overflow-y: auto;
overflow-x: hidden;
}
tbody { border-top: 2px solid black; }
tbody td, thead th {
/* width: 20%; */ /* Optional */
border-right: 1px solid black;
/* white-space: nowrap; */
}
tbody td:last-child, thead th:last-child {
border-right: none;
}
最佳答案
经过长时间的试验,这里是解决方案。特立尼达将 thead 放在 tbody 标签内,因此首先要补救,将其添加到 Jquery 下方以执行将它们排列在表 -thead/-tbody 中的技巧。
var $table = $("table.af_table_content");
$table.find('tbody tr:first')
.wrap('<thead/>')
.parent()
.prependTo($table);
现在您的表格已采用预期格式,现在您可以按照任何可用的可滚动方法进行操作。我跟着做了这个 css
.af_table_content {
border-spacing: 1;
border: 1px solid black;
width:80%;
}
.af_table_content tbody, .af_table_content thead {
display: block;
}
.af_table_content tbody tr {
table-layout:fixed;
display: inline-table;
width:80%;
}
.af_table_content thead tr {
table-layout:fixed;
display: inline-table;
width:80%;
}
.af_table_content thead tr th {
height: 30px;
line-height: 30px;
/* text-align: left; */
}
.af_table_content tbody {
height: 100px;
overflow-y: auto;
overflow-x: hidden;
border-top: 1px solid black;
position: absolute;
width:80%;
}
.af_table_content tbody td,.af_table_content thead th {
border-right: 1px solid black;
/* white-space: nowrap; */
}
.af_table_content tbody td:last-child,.af_table_content thead th:last-child
{
border-right: none;
}
Jquery 和 CSS 都应该在你准备好表格后调用。所以将它们放在页面中 body 标记的结尾之前(trh:html、f:view、ui:composition)
关于css - 标题固定,可滚动的特立尼达表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37623087/
我目前正在努力寻找资源来帮助我为我受雇的项目学习 Trinidad 2.0。我很难找到 2.0 的资源,尽管 1.2 有很多资源。 通常这表明一项技术已经失宠,并且有更好的选择可供选择。特立尼达只是在
我有一个 tr:table,其 rowSelection 属性设置为“single”。它绘制了一个额外的列,里面有一个单选按钮。但我想更改该列标题处显示的文本。我没有找到任何可以让我完成此任务的属性。
我正在使用 tr:table 并且我想在单元格之间添加间距,这样它们就不会彼此靠近 生成的 html 具有属性 cellSpacing = 0 标签没有这样的属性。 我该怎么做? 谢谢, 约翰。 最佳
当我的用户在单击复选框后按“Enter”键时,我的表单应该表现得就像按下“下一步”按钮一样。但是,我正在使用 PPR(部分页面渲染),因此当单击它时,我的复选框会触发“下一步”按钮进行重新绘制。这是通
问题: 我们有一个基于 Apache MyFaces Trinidad 的 Java 网络应用程序。当一个字段包含一些特殊字符(例如 Ñ、á 等)时,我们在尝试部分提交(仅此而已:通过 Ajax)表单
我有一个简单的要求:我的的列数是动态的。我将有一个对象列表,someBean.features这将决定渲染多少列。 下图应该可以阐明我的要求。 在我得到的代码中,使用了 JSTL 标签在 JSF 环境
我是一名优秀的程序员,十分优秀!