'How to make the table in word using PHPWord which includes multiple rowspan and colspan?

I have been learning the PHPWord for my academic project, and I also have the latest PHPWord library which supports "vMerge" for rowspan and "gridSpan" for colspan.

I have been finding difficulty in creating one particular type of table structure as shown in the Image below.

enter image description here

The problem is how to have same rowspan for '1','2' and '6' , in this case it is equal to 2.

Any kind of help would be appreciated.

edit-1 I have succeeded with basic rowspan and colspan, but I am finding difficulty with this complex table.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source