Skip to main content
< All Articles

How to color code and format lists and libraries in SharePoint Online

Posted on January 6, 2022
Lists

Most of us rely on visualizations to make sense of data. That’s why we, humans, are attracted to colorful graphs and charts, like cats are to laser pointers. Ever since we got SharePoint lists and libraries, we had a need to make them a little more fun and visually appealing. Unfortunately, up until recently, this was only possible to those with a development background, as adding color to lists and libraries required an injection of code. Not anymore. With the recent improvements to Microsoft lists and Document Libraries, we now have the ability to color code and format individual cells, rows, or entire views, just like you can in Excel. Let me explain how this works.

Formatting options are available on both lists and libraries, so for this article, I will use an example list, but once again, document libraries have the same formatting options as well.

There are 2 things you can format in a given list or library:

  1. Columns
  2. Views

When you format a column, you are just color-coding a given column. When you format a view, you are color-coding the rows of information (the entire list or library/data set). With further explanation and images below, it will become more obvious.

1. Format Columns

To format a column, click on a drop-down next to the column you want to format/color-code, then Columns Settings > Format this column.

color code and format lists and libraries

You may have up to 3 choices available (depends on the type of column you are formatting).

Background Colors

This method fills the whole cell with a specific color based on a certain value of a cell.

You can also edit the styles (colors) if need be.
Choice Pills

This method is only available on Choice Type columns and color-codes the cell in a pill (oval) style format based on a certain value of a cell.

color code and format lists and libraries

The same exact functionality can be accessed when you create a new Choice column or edit an existing Choice column.

color code and format lists and libraries

Conditional Formatting

This method allows you to color-code cells based on the values of other cells. For example: If the date value is less than Today, format the cell as Green. If it is greater than Today, format it as Red.

color code and format lists and libraries

What’s cool about this feature is that you can create conditional formulas based on various columns in the list or library by using AND/OR boolean operators.

2. Format Views

Unlike the Column formatting described above, this method applies color to the whole row within a given view based on some logic. To access the view formatting, click on the All Items (or All Documents in case of the document library) drop-down and choose Format Current View.

Alternating Row Styles

This option sets 2 unique and alternating colors for odd and even rows of the list/library.

color code and format lists and libraries

Conditional Formatting

This is just like Column Conditional Formatting described above, but color codes the entire row (not just the cell).

color code and format lists and libraries