Column header formatting in SharePoint list Quick Edit or Datasheet View

Column header formatting in SharePoint list Quick Edit or Datasheet View – Microsoft 365

One comment

Loading

In this “Column header formatting in SharePoint list” 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:

Format column heading – Column header formatting in SharePoint list Quick Edit or Datasheet View

Navigate to the list.

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, and 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), where we can see that the column header color has been changed.

Column header formatting in SharePoint list – Demo

Now open the same list again to see the changes:

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, and we can see the formatted column header along with alternate rows color changes which look like excel.

Column header formatting in SharePoint list (format column heading) – Demo

Navigate to the same list to see the changes.

List view formatted with alternate rows color change
List view formatted with alternate rows color change

Note:

  • The above CSS works well in 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 “Web part” 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: Column header formatting in SharePoint list Quick Edit or Datasheet View (format column heading)

Thus, in this article, we have learned the below concepts with respect to 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: SharePoint Online tutorial

You may also like the below SharePoint Online tutorials:

Download SharePoint Online PDF Book

Download SharePoint Online & Office 365 Administration eBook

Buy the premium version of SharePoint Online & Office 365 administration eBook from here:



Buy SharePoint Online & Office 365 Administration eBook


 

Get the free demo PDF eBook from here:

FREE DOWNLOAD

Send download link to:

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

About Post Author

1 comments on “Column header formatting in SharePoint list Quick Edit or Datasheet View – Microsoft 365”

Do you have a better solution or question on this topic? Please leave a comment