How to sum all quantity in table?

How to sum all quantity in table?

Lucaslopez12Lucaslopez12 Posts: 14Questions: 6Answers: 0
edited January 2022 in DataTables

hello. I have the following multi dimensional array.

what I want is for it to show me the total of QUANTITY that matches the same MARCA but I can't do it. I only add QUANTITY to DESCRIPTION

Table:

This is how I'm sending data to the table

I tried to change seller.description to seller.Marca but it still shows me the sum of the description and not the Marca. How can I do?

Replies

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    It looks like you've got colspan in the table body, which isn't supported. You might want to look at RowGroup, particularly this example, as it may be doing what you want.

    Colin

  • kthorngrenkthorngren Posts: 21,322Questions: 26Answers: 4,949

    @Lucaslopez12 you are using the RowsGroup which is a third party plugin. This is using the colspan that Colin is referring to. Since its not something Datatables provides or supports you should mention you are using it in relevant threads :smile:

    This is how I'm sending data to the table

    Where are you using this code? The code snippet will be difficult to debug without seeing it run. Please provide a test case with an example of what you have so we can take a look.
    https://datatables.net/manual/tech-notes/10

    Kevin

Sign In or Register to comment.