Combine parts of same data HTML table

I use Mustache to display dynamically data for Users in a Table, (It is a WordPress Site and the plugin uses Mustache to precise)

So my users are able to add when logged in in repeater fields data then I display the data in HTML Table

Name - Points - Date
John - 10 - 15.06.2019
John - 15 - 15.06.2019
Max - 26 - 15.06.2019

So in this example, John is listed in Table 2 times I want for every John to combine the Points and display in one row.

So like this,

Name - Points - Date
John - 25 - 15.06.2019
Max - 26 - 15.06.2019

Any idea how to do this? Thanks

What does your current code look like which displays this data?

Yes: http://jsfiddle.net/k20an9yw/1/
I have now something that I think is going in the right direction but I still need help here because I need to sum the Points together, When you under Max, for example, change the 8 Points also to 5 then the output will be one cell with 5 instead of 10 what I would need, Also in the right I have entered a description the sum of all points together need to be calculated then with * 5 and displayed in the last cell

thanks

If I am reading your last comment correctly, you are wanting to sum the 5 and 8 to be 13 and multiple it by 5 and display the result (65) in the cell where it says “total points Max * 5 here”?

And for Peter, you want to sum 9, 22, 12, and 19 to be 65 and then multiple by 5 and display the result (310) in the cell where it says “total points Peter * 5 here”?

Exactly this is what I need, but it also need to merge together im one cell instead of 2 like on Max for example

So under the Points column for Max, it would show 13 and 65 for Peter?

Correct this is what I try to do.

So you are you scraping a site to get the original table (in the HTML) which looks like below?

<table class="tablecss">
<thead>
		<tr>
      <th>Name</th>
		  <th>Points</th>
		  <th>Points * 5</th>
		</tr>
	</thead>
<tbody class="actionbody">
    <tr>
        <td>Max</td>
        <td>5</td>
        <td>total points Max * 5 here</td>
    </tr>
    <tr>
        <td>Max</td>
        <td>5</td>
        <td>total points Max * 5 here</td>
    </tr>
    <tr>
        <td>Max</td>
        <td>8</td>
        <td>total points Max * 5 here</td>
    </tr>
    
    <tr>
        <td>Peter</td>
        <td>9</td>
        <td>total points Peter * 5 here</td>
    </tr>
    <tr>
        <td>Peter</td>
        <td>22</td>
        <td>total points Peter * 5 here</td>
    </tr>
    <tr>
        <td>Peter</td>
        <td>12</td>
        <td>total points Peter * 5 here</td>
    </tr>
    
    <tr>
        <td>Peter</td>
        <td>19</td>
        <td>total points Peter * 5 here</td>
    </tr>
</tbody>
</table>

If not, I don’t understand why you have all the repeated cells like the following in the original table?

<td>total points Peter * 5 here</td>

Like I said this WordPress Plugin is working with Mustache shortcodes and the data I display is entered by the Users I display it only with the help of the shortcode on the Site.

{{meta_repeat_19}} this for example is the Shortcode for Points, it can be multiple times rendered for one User if he enters more data in the repeater field that is located in the user area of the Site.

<table class="table">
	<thead>
		<tr>
          <th scope="col">Name</th>
		  <th scope="col">Points</th>
		  <th scope="col">Total</th>
		</tr>
	</thead>
	<tbody>
		{{#users}}
      {{#meta_repeat}}
		<tr class="vvf">
          <td data-label="Name">{{meta_first_name}} {{meta_last_name}}</td>
		  <td data-label="Points">{{meta_repeat_19}}</td>
		  <td data-label="Total">Total  goes here</td>
		</tr>
      {{/meta_repeat}}
		{{/users}}
	</tbody>
</table>

Maybe I can make use of User ID shortcode {{user_id}} so the code knows for every User ID that is same do this Merge and Calculations ?

I would create the summary (the sum of the points) and the sum of the points * 5 for each user and then dynamically generate a row for each user. That way you are not trying to create a hack solution based on extra cells you do not even need for the final output.

What I mean is you should create the table once and once only by building it from where ever you are getting the data to begin with. However, this is just my opinion.