How do I divide a row in sub rows? If I want to divide a row into some sub-rows in Drupal 8, what should the code be?



The following code worked fine for simple tables. I need to do something with the $rows array to divide the rows in sub-rows. How can I achieve this? 

$form['mytable'] = array(
  '#theme'  =&gt; 'table',
  '#header' =&gt; $header,
  '#rows'   =&gt; $rows,
  '#empty'  =&gt; t('Not Found.'),
);
Drupal 8:

$table = [
  '#type' =&gt; 'table',
  '#header' =&gt; ['ab', 'cd', 'ef'],
  [
    [
      '#plain_text' =&gt; 'rowspan',
      '#wrapper_attributes' =&gt; ['rowspan' =&gt; 2],
    ],
    ['#markup' =&gt; '1'],
    ['#markup' =&gt; '1'],
  ],
  [['#markup' =&gt; '1'], ['#markup' =&gt; '1']],
];


Result:



See Drupal Documentation for a colspan example