• Ivy Seo

ngx-datatable style / css class

To style ngx-datatable,

you want to edit in 'datatable.component.scss' file, instead of 'yourfile.component.css'


I've been struggling to apply striped style (highlight every other row) to ngx-datatable like this:



'nth-child(even)' did not work.

The simple solution was using 'datatable-row-even' keyword:

 .datatable-row-even{background-color: #bb965d !important; color: black;} 

CSS Classes in ngx-datatable:

  • ngx-datatable: Master Table class

  • fixed-header: The header is fixed on the table

  • datatable-header: Header row class

  • datatable-header-cell: Header cell class

  • resizeable: Cell resizeable class

  • sortable: Cell drag/drop sortable class

  • longpress: Cell long-press activated

  • dragging: Cell dragging activated

  • sort-active: Sort active on column

  • sort-asc: Sort active on column with ascending applied

  • sort-desc: Sort active on column with descending applied

  • datatable-header-cell-label: Header cell text label

  • draggable: Header cell draggable class

  • datatable-body-row: Body row class

  • datatable-row-even: Odd row class

  • datatable-row-odd: Even row class

  • datatable-body-cell: Body cell class

  • sort-active: Sort active on column

  • sort-asc: Sort active on column with ascending applied

  • sort-desc: Sort active on column with descending applied




Recent Posts

See All

Generate unique filename: UUID, Path

A: using UUID let my_uuid = Uuid::new_v4(); let file_created = File::create(my_uuid.to_string()).expect("create file failed");     println!("uuid: {}", my_uuid); //  buffer write let mut file_ge

JSON - write .txt file in Rust

pub fn serialize_writeFile(data : &full_data ) -> Result<bool, modbus::Error> { // 1) takes data  // this function takes the m7_data object and serializes the contents and saves the results to a text

Serialize/Deserialize JSON in Rust

This README has some good examples. To deserialize in Rust: use serde::{Deserialize, Serialize}; use serde_json::Result; #[derive(Serialize, Deserialize)] struct Person {     name: String,     age: u