Author Topic: How to add multiple style classes to individual cell  (Read 2652 times)

ntoscano

  • Pro OEM
  • Newbie
  • *
  • Posts: 6
    • View Profile
How to add multiple style classes to individual cell
« on: October 28, 2016, 03:26:19 am »
If a particular cell in a row as multiple styles ( bold, underline, top-align, etc..), how can you add the individual classes to the cell?
I've tried the following structure with no success:
Code: [Select]
var data = [
    {rank:4, company:'BP', revenues:'267,600.0',profits: '22,341.0', pq_rowcls: "red", pq_cellcls: { "company": { color : "green", bold: true} },
    {rank:5, company: 'General Motors',revenues: '192,604.0', profits:'-10,567.0'},
   
];

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: How to add multiple style classes to individual cell
« Reply #1 on: October 28, 2016, 07:18:45 pm »
1. Css styles can be applied as either inline styles http://paramquery.com/pro/demos/row_styles

2. or by css classes, http://paramquery.com/pro/demos/row_class ( don't forget to check css tab  in this demo)

3. there are also other ways to add styles like conditional styles. http://paramquery.com/pro/demos/condition_style


I assume your question is about adding multiple styles with help of css classes.

In JSON data define pq_cellcls: { company: 'some_cls' }

And in css assign css rules to that class:

Code: [Select]
tr td.some_cls{
  color: green;
  font-weight: bold;
  text-decoration: underline;
}

Hope it answers your question.
« Last Edit: October 28, 2016, 07:20:37 pm by paramquery »

ntoscano

  • Pro OEM
  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: How to add multiple style classes to individual cell
« Reply #2 on: October 29, 2016, 03:39:17 am »
Thanks, this solved my problem: http://paramquery.com/pro/demos/condition_style