gpt4 book ai didi

twitter-bootstrap - 如何为 tablesorter 和 bootstrap 设置 css?

转载 作者:行者123 更新时间:2023-12-04 17:38:19 25 4
gpt4 key购买 nike

Tablesorter 可以在 Bootstrap 2 中正确排序,但我不知道如何设置表头的颜色和插入符号。

我找到的最有可能的css here是:

table .header {
cursor: pointer;
}

table .header:after {
content: "";
float: right;
margin-top: 7px;
border-width: 0 4px 4px;
border-style: solid;
border-color: #000000 transparent;
visibility: hidden;
}

table .headerSortUp, table .headerSortDown {
background-color: #f7f7f9;
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
}

table .header:hover:after {
visibility: visible;
}

table .headerSortDown:after, table .headerSortDown:hover:after {
visibility: visible;
filter: alpha(opacity=60);
-moz-opacity: 0.6;
opacity: 0.6;
}

table .headerSortUp:after {
border-bottom: none;
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-top: 4px solid #000000;
visibility: visible;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
filter: alpha(opacity=60);
-moz-opacity: 0.6;
opacity: 0.6;
}

但没有运气。

有人能分享一下成功的故事吗?

最佳答案

也许它应该被添加到原始 style.css 文件( demo ):

/* tables */
table.tablesorter {
font-family:arial;
background-color: #CDCDCD;
margin:10px 0pt 15px;
font-size: 8pt;
width: 100%;
text-align: left;
}
table.tablesorter thead tr th, table.tablesorter tfoot tr th {
background-color: #e6EEEE;
border: 1px solid #FFF;
font-size: 8pt;
padding: 4px;
}
table.tablesorter thead tr .header {
background-image: url(bg.gif);
background-repeat: no-repeat;
background-position: center right;
cursor: pointer;
}
table.tablesorter tbody td {
color: #3D3D3D;
padding: 4px;
background-color: #FFF;
vertical-align: top;
}
table.tablesorter tbody tr.odd td {
background-color:#F0F0F6;
}
table.tablesorter thead tr .headerSortUp {
background-image: url(asc.gif);
}
table.tablesorter thead tr .headerSortDown {
background-image: url(desc.gif);
}
table.tablesorter thead tr .headerSortDown, table.tablesorter thead tr .headerSortUp {
background-color: #8dbdd8;
}
table .header {
cursor: pointer;
}

/* bootstrap */
table.tablesorter .header:after {
content: "";
float: right;
margin-top: 7px;
border-width: 0 4px 4px;
border-style: solid;
border-color: #000000 transparent;
visibility: hidden;
}
table.tablesorter .headerSortUp, table .headerSortDown {
background-color: #f7f7f9;
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
}
table.tablesorter .header:hover:after {
visibility: visible;
}
table.tablesorter .headerSortDown:after, table .headerSortDown:hover:after {
visibility: visible;
filter: alpha(opacity=60);
-moz-opacity: 0.6;
opacity: 0.6;
}
table.tablesorter .headerSortUp:after {
border-bottom: none;
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-top: 4px solid #000000;
visibility: visible;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
filter: alpha(opacity=60);
-moz-opacity: 0.6;
opacity: 0.6;
}

此外,如果您想在标题中添加任何额外的 HTML,有一个未记录的 onRenderHeader例如,您可以使用该选项在每个标题内添加一个跨度( ref ):
$(function(){
$("table").tablesorter({
onRenderHeader: function(){
this.prepend('<span class="icon"></span>');
}
});
});

关于twitter-bootstrap - 如何为 tablesorter 和 bootstrap 设置 css?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11056699/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com