How can I render an HTML table in a block?
You can use the table theme type to do this.  In your build section, return a render array that includes this:

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


Where header is an array of strings and rows is an array of row value arrays.

Some reference items I found:

New render element #type 'table'

Render arrays