<?php namespace FOO; ?>

<div style="<?= $panel_style ?>; display: table; width: 100%">

  <div style="<?= $table_container_style ?>">

    <?php if($vertical): ?>
      <?php require(__DIR__ . '/alert_list.php'); ?>
    <?php else: ?>
      <?php require(__DIR__ . '/alert_table.php'); ?>
    <?php endif ?>

  </div>

  <div style="display:table-header-group;">
  <h2 style="<?= $panel_content_style ?>">
    <a style="<?= $link_style ?>" href="<?= $base_url ?>/search/<?= $search['id'] ?>"><?= Util::escape($search['name']) ?></a>
    <small style="<?= $sub_style ?>">[<?= count($alerts) ?> Alert<?= count($alerts) != 1 ? 's':'' ?>]</small>
  </h2>

  <p style="<?= $panel_content_style ?>">
    <?= nl2br(Util::escape($search['description'])) ?>
    <?php if($search->isTimeBased()): ?>
      <br>
      <br>
      <b>Time range: </b><?= $search['range'] ?> minute(s)
    <?php endif ?>
  </p>
</div>

</div>

<?php namespace FOO; ?>

<div style="<?= $panel_style ?>; display: table; width: 100%">

  <div style="display:table-header-group;">
    <h2 style="<?= $panel_content_style ?>">
      <a style="<?= $link_style ?>" href="<?= $base_url ?>/search/<?= $search['id'] ?>"><?= Util::escape($search['name']) ?></a>
      <small style="<?= $sub_style ?>">[<?= count($alerts) ?> Alert<?= count($alerts) != 1 ? 's':'' ?>]</small>
    </h2>

    <p style="<?= $panel_content_style ?>">
      <?= nl2br(Util::escape($search['description'])) ?>
      <?php if($search->isTimeBased()): ?>
        <br>
        <br>
        <b>Time range: </b><?= $search['range'] ?> minute(s)
      <?php endif ?>
    </p>
  </div>

  <div style="<?= $table_container_style ?>">

    <?php if($vertical): ?>
      <?php require(__DIR__ . '/alert_list.php'); ?>
    <?php else: ?>
      <?php require(__DIR__ . '/alert_table.php'); ?>
    <?php endif ?>

  </div>

</div>

Revert table ordering tweaks to alert list
Revert table ordering tweaks to alert list

This causes weird behaviour in GMail because of how it hides duplicated
content. The header toggles between under/over the alert list on every
other email.
