How do I create a simple table?
As reported in New render element #type 'table' and theme() renamed to _theme() and should not be called directly, the equivalent of $table = theme('table', array('header' =&gt; $header, 'rows' =&gt; $rows)) for Drupal 8 is the following.

$form['table'] = [
  '#type' =&gt; 'table',
  '#header' =&gt; $header,
  '#rows' =&gt; $rows,
];


(Replace $form with the variable containing the rendering array.)