Column header formatting in SharePoint list Quick Edit or Datasheet View

Column header formatting in SharePoint list Quick Edit or Datasheet View

No comments

 15,106 total views,  220 views today

In this post, we will learn how we can format the column header in SharePoint quick edit view or datasheet view and in the custom list view. Below is the default list view look:
SharePoint List view formatting - Default look of SharePoint list view
SharePoint List view formatting – Default look of SharePoint list view
Add the below CSS in the script editor web part:
<style>
/*Choose the column header background color*/
.ms-viewheadertr
{
background:Navy;
font-weight:bold;
}
.ms-spGrid-HeaderContentStyle
{
font-weight:bold;
font-size:20em;
}

/*Choose the column header font style*/

.ms-vh2-nofilter,.ms-spGrid-HeaderContentStyle, .ms-vh2, a.ms-headerSortTitleLink
{
font-weight:bold;
color:DarkWhite;
font-size:2.05em;
}
</style>
Add the above CSS inside the script editor web part.
SharePoint List view formatting - add css in script editor web part
SharePoint List view formatting – add CSS in script editor web part
Now, navigate to the list view page, we can see the formatted column header.
SharePoint List view formatting - formatted column after adding the CSS
SharePoint List view formatting – formatted column after adding the CSS
  Now, switch to a quick edit view(datasheet view), there we can see that column header color has been changed.
Formatted column in SharePoint Quick Edit view,after adding the CSS
The formatted column in SharePoint Quick Edit view, after adding the CSS
Note:
  • There was a known issue in quick view list column header text formatting – so there is an open thread in the Microsoft Technet community – I am following this, once I get the answer, I will update the post. Below is the link to that thread.             Column header formatting for Lists when using Quick Edit
Now, we will learn how we can apply some more CSS to style the SharePoint list view which will look like excel formatting. Similar to the above script editor web part – add the below CSS inside another script editor web part.
<style type="text/css">

/* List view header CSS - clumn header background color */
.ms-listviewtable > thead > tr > th {
background-color: DarkBlue;
}

/* List view header text color - column header*/
.ms-vh-div, .ms-headerSortTitleLink {
color:white!important; 
font-weight: bold;
}

/* background color for alternate rows in the list items */
.ms-listviewtable > tbody > tr.ms-alternating
 {
background: cyan;
}
</style>
  Now, navigate to the custom list view, we can see the formatted column header along with alternate rows color changes which look like excel.
List view formatted with alternate rows color change
List view formatted with alternate rows color change
Note:
  • The above CSS works well in the SharePoint 2016/2013 and online in the list view only – it does not work in the datasheet view.
Quick recap, how we can add the script editor web part on the SharePoint page. Click on the gear icon from the top right-most corner of the page -> Click on the “Edit Page” -> Click on the “Insert” tab from the ribbon -> Click on the “Webpart” link -> Under the Categories click on the “Media and Content” -> Then from the web part section click on the “Script Editor” -> Click on the “Add” button.
How to add script editor web part in the SharePoint page
How to add the script editor web part on the SharePoint page?
Summary : Thus, in this article, we have learned the below concepts with respect styling the SharePoint list column header :
  • How to format and style the SharePoint list view column header using CSS.
  • How to format and style the SharePoint datasheet column header using CSS.
  • How to format and style the alternate rows of the list items in the SharePoint custom list.
  • How to bold the column header row in the SharePoint list view.
  • How to change the SharePoint list column background color.

See Also:

Free download SharePoint Online & Office 365 Administration eBook(238 Pages)

Get the PDF eBook from here:


[purchase_link id="0" style="button" color="blue" text="Free Download SharePoint Online & Office 365 Administration"]

 

 
FREE DOWNLOAD

Send download link to:

Subscribe to get exclusive content and recommendations every month. You can unsubscribe anytime.