Вот так кладу:
return [
[
'#type' => 'table',
'#header' => $headers,
'#footer' => $footer,
'#rows' => $rows,
'#attributes' => ['class' => ['table', 'table-striped', 'table-hover']],
'#allowed_tags' => ['p', 'table', 'tr', 'td', 'th', 'small', 'br'],
],