cumulative column
cumulative column
saikalyan9981
Posts: 10Questions: 3Answers: 0
Is there a way to add a column with cumulative values? For example,
I have a table:
id | product | price
1 | camera | 200
2 | watch | 100
3 | pencil | 20
4 | wallet | 10
I want to add an extra column and make the table like this:
id | product | price | cumulative price |
1 | camera | 200 | 200 |
2 | watch | 100 | 300 |
3 | pencil | 20 | 320 |
4 | wallet | 10 | 330 |
This discussion has been closed.
Answers
Its possible, but it isn't something that DataTables will do out of the box. This example shows the basic principle, you would need to modify it to do the cumulative sum.
Allan
Hi @saikalyan9981 ,
You can use
drawCallback
, as in this example.Cheers,
Colin