I have a question related to a dynamically mounted table.
So I wanted to know how I can edit the table removing values from rows according to values from another column with jquery? For example, I have the following table:
Start | End | balance | Trail | Id |
---|---|---|---|---|
01/11/2022 | 01/15/2022 | 4 | high stretch | 2 |
01/11/2022 | 01/15/2022 | 4 | low stretch | 2 |
01/25/2022 | 01/30/2022 | 6 | high stretch | 4 |
01/25/2022 | 01/30/2022 | 6 | inert stretch | 4 |
01/25/2022 | 01/30/2022 | 6 | low stretch | 4 |
Given this table, I wanted to do a merge based on the Id column, removing the balance values, as they are repeated for the same Id and in the end make the sum, returning the balance total.
So the new table would look like this:
Start | End | balance | Trail | Id |
---|---|---|---|---|
01/11/2022 | 01/15/2022 | 4 | high stretch | 2 |
01/11/2022 | 01/15/2022 | low stretch | 2 | |
01/25/2022 | 01/30/2022 | 6 | high stretch | 4 |
01/25/2022 | 01/30/2022 | inert stretch | 4 | |
01/25/2022 | 01/30/2022 | low stretch | 4 | |
Total | 10 |
Any idea how I can do this with jquery?
An important detail, this table is dynamically generated, so I can have more rows being generated with other values from other Ids or the same Id.
