<table ng-if="rows" class="table agg-table-group">
  <thead ng-repeat-start="table in rows">
    <tr>
      <th ng-if="table.tables">
        <span class="agg-table-group-header">{{ table.title }}</span>
      </th>
    </tr>
  </thead>
  <tbody ng-repeat-end>
    <tr>
      <td>
        <kbn-agg-table-group
          ng-if="table.tables"
          group="table"
          per-page="perPage"
          sort="sort"
          show-total="showTotal"
          total-func="totalFunc"></kbn-agg-table-group>
        <kbn-agg-table
          ng-if="table.rows"
          table="table"
          export-title="exportTitle"
          per-page="perPage"
          sort="sort"
          show-total="showTotal"
          total-func="totalFunc">
        </kbn-agg-table>
      </td>
    </tr>
  </tbody>
</table>

<table ng-if="columns" class="table agg-table-group">
  <thead>
    <tr>
      <th ng-repeat="table in columns" ng-if="table.tables">
        <span class="agg-table-group-header">{{ table.title }}</span>
      </th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td ng-repeat="table in columns">
        <kbn-agg-table-group
          ng-if="table.tables"
          group="table"
          per-page="perPage"
          sort="sort"
          show-total="showTotal"
          total-func="totalFunc"></kbn-agg-table-group>
        <kbn-agg-table
          ng-if="table.rows"
          table="table"
          export-title="exportTitle"
          per-page="perPage"
          sort="sort"
          show-total="showTotal"
          total-func="totalFunc">
        </kbn-agg-table>
      </td>
    </tr>
  </tbody>
</table>
