How to create a complex header?

I was using setColumnHeader(Object, String) to set a simple string as a column header. I want to create a complex header. I would like to know if there is any way to build a similar table as shown in the below figure.

Pushing up. Anybody there? Please share if you have any idea.

I did the same manually with GridLayout. It looks like that:

Could you please tell, how you did this?

I already wrote that it was done with GridLayout (https://vaadin.com/book/-/page/layout.gridlayout.html)