Render database values using 'markup tags' other than 'table tags' to keep things simple, I am trying to load a specific set of values from a database, which using the following code works:

foreach ( database::load() as $bdt) {
  $row[] = (array) $bdt;
}

$content['table'] = array(
  '#type' =&gt; 'table',
  '#rows' =&gt; $row,
  '#empty' =&gt; t('No entries available.'),
);


Which produces the following:

&lt;table&gt;
  &lt;tbody&gt;
          &lt;tr&gt;
                  &lt;td&gt;5.00 PM&lt;/td&gt;
              &lt;/tr&gt;
          &lt;tr&gt;
                  &lt;td&gt;1:00 PM&lt;/td&gt;
              &lt;/tr&gt;
          &lt;tr&gt;
                  &lt;td&gt;1:00 PM&lt;/td&gt;
              &lt;/tr&gt;
          &lt;tr&gt;
                  &lt;td&gt;3:00 PM&lt;/td&gt;
              &lt;/tr&gt;
          &lt;tr&gt;
                  &lt;td&gt;3:00 PM&lt;/td&gt;
              &lt;/tr&gt;
          &lt;tr&gt;
                  &lt;td&gt;5:00 PM&lt;/td&gt;
              &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;


But I don't want to use table formats and I want to use other html markup tags, such as "&lt;p&gt;" or "&lt;div&gt;". I have tried to change the '#type' => 'table' to '#markup' but it will not render anything.

$content['table'] = array('#markup =&gt; '&lt;p&gt;&lt;span class="blue"&gt;time&lt;/span&gt; ' . $row '&lt;/p&gt;',);


I have searched a few sites about it, but all point information back to using table format.

The working code was extracted from the "example modules" using the DBTNG example.

Please can anyone tell me how to go about it?

Many Thanks
As you do not like table.html.twig, I suggest to write your own table theme. As a reference, you can look how this is done for field_ui_table in core.

Or you use inline_template:

$content['table'] = [
   '#type' =&gt; 'inline_template',
   '#template' =&gt; '{%- for row_value in row -%}&lt;p&gt;&lt;span class="blue"&gt; time &lt;/span&gt;{{ row_value }}&lt;/p&gt;{%- endfor -%}',
   '#context' =&gt; ['row' =&gt; $row],
 ];