slick grid column (text-align)

Premanshu picture Premanshu · Oct 25, 2011 · Viewed 9.4k times · Source

Is there any way to align the header in a slick grid to center and the text in the columns to left? any css files need modification or something else?

Please guide.

var columns = [ 
  { id: "colEmpId", name: 'Number', field: "EmpId", "unselectable": false }, 
  { id: "colLastName", name: 'Last Name', field: "LastName", "unselectable": false }, 
  { id: "colFirstName", name: 'First Name', field: "FirstName", "unselectable": false } 
]; 

This is column definition

Answer

njr101 picture njr101 · Oct 25, 2011

You can style the headings using the built-in classes in the css sheet.: .slick-header .slick-header-column .slick-header-columns .slick-headerrow-column .slick-headerrow-columns

For text in the columns you can assign a custom css class in the column definition and add this to your style sheet.

e.g.

var columns = [ { id: "colEmpId", name: 'Number', cssClass: "column-empid" },  ...