HTML table to Drupal table How can I translate this to drupal table?

http://www.bootply.com/sXmuAJQjO4

I know how to do simple tables and the header and first row I can do also with this code:

$title = '&lt;div class="panel panel-default"&gt;
&lt;div class="panel-heading"&gt;&lt;h3&gt;Table Title&lt;/h3&gt;&lt;/div&gt;
&lt;div class="panel-body"&gt;';

    $header = array(
        array('data' =&gt; '&amp;nbsp;'),
        array('data' =&gt; 'Job Name'),
        array('data' =&gt; 'Description'),
        array('data' =&gt; 'Provider Name'),
        array('data' =&gt; 'Region',),
        array('data' =&gt; 'Status'),
    );

    #'data-toggle' =&gt; 'collapse'
    $row = array(
        'data' =&gt; array(
            array('data' =&gt; '&lt;button class="btn btn-default btn-xs"&gt;&lt;span class="glyphicon glyphicon-info-sign"&gt;&lt;/span&gt;&lt;/button&gt;'),
            array('data' =&gt; 'OBS Name',),
            array('data' =&gt; 'OBS Description'),
            array('data' =&gt; 'hpcloud'),
            array('data' =&gt; 'nova'),
            array('data' =&gt; 'created'),
        ),
        'class' =&gt; array('accordion-toggle'),
        'data-toggle' =&gt; 'collapse',
        'data-target' =&gt; '#demo1',
    );
    $rows[] = $row;


But I can't add the hidden row. Can anyone help me?

Thanks!
For the hidden row, you need a second table which would look like:

// This is the hidden table
$table_hidden = '&lt;div class="accordian-body collapse" id="demo1"&gt;';
$table_hidden .= theme('table', array('header' =&gt; $header_hidden, 'rows' =&gt; $rows_hidden));
$table_hidden .= '&lt;/div&gt;';

$row2 = array(
  'data' =&gt; array(
    array(
      'data' =&gt; $table_hidden,
      'colspan' =&gt; '12',
      'class' =&gt; array('hiddenRow'),
    ),
    array('data' =&gt; 'OBS Name',),
  // more array data here
); 


Option 2, a more module-clean way would be to use hook_theme function and create a simple template file where additional markup is placed like so.

function YOURMODULE_theme($existing, $type, $theme, $path) {
  return array(
    'any_name_you_like' =&gt; array(
      'template' =&gt; 'hiddentable', // This called hiddentable.tpl.php
      'arguments' =&gt; array('table' =&gt; null),
    ),
  );
}


Then in your page callback or wherever, you would just need to use your declared theme function like so.

$table_hidden = theme('table', array('header' =&gt; $header_hidden, 'rows' =&gt; $rows_hidden));

$row2 = array(
  'data' =&gt; array(
    array(
      'data' =&gt; theme('any_name_you_like', array('table' =&gt; $table_hidden)),
      'colspan' =&gt; '12',
      'class' =&gt; array('hiddenRow'),
    ),
    array('data' =&gt; 'OBS Name',),
  // more array data here
); 


Now in your hiddentable.tpl.php

&lt;div class="accordian-body collapse" id="demo1"&gt;
  &lt;?php print $variables['table']; ?&gt;
&lt;/div&gt;