5

I am using the following css to style the headers of a list:

.ms-vh, .ms-vh2-nofilter, .ms-vh2-nograd, .ms-vh2, .ms-vb{
      text-align:left;
      color:red;
  }

This seems to work for every column except for columns with 'number' as data type. How to make this work?

2

Try to include at least .ms-vh2 a in addition to what you have. Based on my tests the column using the type of Number uses this class.

Update: To apply the text-align:left styling, the .ms-vh2 .ms-numHeader class should be included.

  • Thanks. The color changes, but the text-align is unchanged. It is important that all column header text is aligned left. – Citizen SP Jan 7 '16 at 11:09
  • 2
    @CitizenDB for me using text-align:left !Important did the trick. EDIT: or not - also include the class .ms-vh2 .ms-numHeader! – moe Jan 7 '16 at 11:18
  • Thanks! ms-numHeader did the trick. Please update your answer so I can accept it. – Citizen SP Jan 7 '16 at 11:59
  • @CitizenDB: updated. – moe Jan 7 '16 at 13:32
  • for other fields types you can use this css code in the header of SharePoint list : .ms-vh-div { text-align:left } – saber tabatabaee yazdi Sep 11 '17 at 14:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.