Skip to content
Advertisement

How to get array from list

I have a problem for my program.

This my script:

JavaScript

and this is my result

result page

I want to replace the words “count” with the sum of each column in the same row. and my question, how I can add all column in one rows.

example : row 1 = 1 + 0.5 + 0,33 + 0.25 = 2,08

Thank you for helping, I am sorry if my English so bad.

Advertisement

Answer

Try something like this

initialize $count as zero before the inner loop and in inner loop increment county

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement