<?php
$datas = $args['data'];
$tableau = isset($datas['tableau']) ? $datas['tableau'] : '';
$titre = isset($datas['titre']) ? $datas['titre'] : '';


?>
<div class="container max-w-[950px] mx-auto flex flex-col gap-8">
  <?php
  if (!empty($titre)) {
    echo '<div class="table-lp-title">' . $titre . '</div>';
  }

  if (!empty($tableau)) { ?>
    <table class="table-lp">
      <?php if ($tableau['use_header'] && !empty($tableau['header'])) { ?>
        <thead class="table-lp-head">
          <tr>
            <?php
            foreach ($tableau['header'] as $headerCell) {
            ?>
              <th class="">
                <?php echo $headerCell['c'] ?>
              </th>
            <?php
            } ?>
          </tr>
        </thead>
      <?php } ?>
      <?php if (!empty($tableau['body'])) { ?>
        <tbody class="table-lp-body">
          <?php foreach ($tableau['body'] as $row) { ?>
            <tr>
              <?php foreach ($row as $cell) { ?>
                <td class=""><?php echo $cell['c'] ?></td>
              <?php } ?>
            </tr>
          <?php } ?>
        </tbody>
      <?php } ?>
    </table>
  <?php  }  ?>
</div>