I am struggling with this issue for a while and really appreciate if someone can give some idea on how I can move forward with.

The idea is to reduce the number of rows in the table by grouping the relevant data in the below format.

I need to convert the JSON response coming from server (non-grouped data) to a particular format so that I can paint the table with the grouped data.

```

**Initial Layout**
+------------+-----------+--------+------------+
| Category   | Product   |  Size  |   Shipping  
+------------+-----------+--------+------------+
| Category 1 | Product 1 | Big    | Free    | 
| Category 1 | Product 2 | Small  | Free    |
| Category 1 | Product 3 | Big    | Free    |
| Category 1 | Product 4 | Small  | Free    |
+------------+-----------+--------+-------------

**Expected Result**
+------------+----------------------+--------+-----------
| Category   | Product              |  Size  |   Shipping  
+------------+----------------------+--------+------------
| Category 1 | Product 1, Product 3 | Big    | Free    | 
|            | Product 2, Product 4 | Small  | Free    |
+------------+----------------------+--------+----------

```

More details in the jsfiddle: 
<https://jsfiddle.net/zy8kj2tb/2/>

```
// please see the code in jsfiddle

```