[英]Customizing Sharepoint 2013 List Header
我的公司剛剛轉換到SP 2013,我現在正在嘗試創建一個新列表。 我一直在嘗試自定義標題以具有以下屬性:
包裹的文本字體顏色藍色文本對齊 - 中心垂直對齊 - 底部
我找到了一個腳本,允許我在所有列上包裝標題,我嘗試添加顏色和文本對齊。 我一直在遇到的是它只更新了我的一個不可過濾的標題上的顏色和對齊。 我試圖查找每個.ms項目的含義,因為我認為這是我的問題,但我似乎無法找到該問題的答案。 任何幫助將不勝感激!
<style>
.ms-vh, .ms-vh2-nofilter, .ms-vh2-nograd, .ms-vh2, .ms-vb{
white-space: normal;
color:#0000ff;
text-align:center;
vertical-align:text-bottom;
}
</style>
我做了一些測試,這是css文件
---------- Table Rows ----------*/
ms-vh-div,ms-vh2-nofilter,ms-vh-div{
background: #2E4C70;
}
/* Set background for every row */
.ms-listviewtable > tbody > tr {
background: white;
}
Set border for every row */
.ms-listviewtable > tbody > tr td{
border-bottom: 1px solid #AFAFAF !important; /* !important needed over override SharePoint inline style */
}
Set background for every alternating row */
.ms-listviewtable > tbody > tr.ms-alternating {
background: #E2E3E5;
} Table Header Row
Remove background set in SharePoints general data table style */
.ms-listviewtable tr.ms-viewheadertr {
background: transparent;
width:100%;
}
.ms-viewheadertr,
.ms-listviewtable {
width:100%;
}tr.ms-viewheadertr > th.ms-vh2-nograd { color:white;}
Modify background color */
tr.ms-viewheadertr > th.ms-vh2-nograd,
tr.ms-viewheadertr > th.ms-vh-icon, /* Input box and attachment icon */
tr.ms-viewheadertr > th.ms-vh, /* Text */
tr.ms-viewheadertr > th.ms-vh2 ,
tr.ms-viewheadertr >th.ms-vh2-nofilter,
tr.ms-viewheadertr >th.ms-vh-div/* Text */ {
background: #2E4C70;
}
.ms-viewheadertr {
width:100%;
}
Modify background color on hover */
tr.ms-viewheadertr > th.ms-vh:hover,
tr.ms-viewheadertr > th.ms-vh2:hover {
background-color: #273C51;
border-color: #273C51;
}
Modify font color */
.ms-viewheadertr a,
.ms-viewheadertr div {
color: grey;
}
Modify font color on hover */
.ms-viewheadertr a:hover,
.ms-viewheadertr div:hover {
color: blue;
}
更多細節在這里分享經驗
格式不適用於多行文本字段。
添加腳本編輯器Web部件,然后插入:
/*Choose your background colour*/
.ms-viewheadertr{
background:#00426A;
}
/*Choose font style*/
.ms-vh2-nofilter, .ms-vh2, a.ms-headerSortTitleLink {
font-weight:bold;
color:white;
font-size:1.05em;
}
</style>
感謝Nate Chamberlain: https : //natechamberlain.com/2018/07/20/customize-styles-formatting-of-sharepoint-list-column-header-rows/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.