How to sum rows?

Tags: #<Tag:0x00007efc657022a0>

I get columns dynamically from the database, so I don’t know how many columns I’ll have, but the number of rows is fixed.

This is a codepen example

https://codepen.io/elieobeid7/pen/WNbGaeL

I get the number of cars from the database. You define:

  • The price of the car
  • The tax per car

Total price of all cars should be total number of number of cars * price per car

price after tax should be price of a car + tax.

All I can do now is setDataAtCell, I want something like setDataAtRow and I don’t want to specify the cell as an parameter.

Hey @elieobeid7

there is no method to fill the whole row but you can use a FOR loop for all the cells in the dataset - the countCols() will tell you how many columns there are.