All table components (Table, GroupTable, TreeTable, DataGrid and TreeDataGrid) can only display items of the same type. If Category and Subcategory entities have the same set of attributes, consider to make a base class for them (an entity marked as mapped superclass).
Take a look at DataGrid Details Generator (see online demo). It can be useful for your requirements. Pay attention that there is a known Vaadin issue, so that a DataGrid can’t be used as details for a DataGrid.