<?php
    use yii\web\View;
    
    /**
     * @var View   $this
     * @var array  $data
     * @var string $name
     */

?>

<table class="table table-hover">
    <thead>
        <tr>
            <th>#</th>
            <th><?= $name ?></th>
            <th>Сессии</th>
        </tr>
    </thead>
    <tbody>
        <?php
            $i = 1;
            foreach ($data as $key => $value) {
                ?>
                <tr>
                    <th scope="row"><?= $i ?></th>
                    <td><?= $key ?></td>
                    <td><?= $value ?></td>
                </tr>
                <?php
                if ($i === 10) {
                    break;
                }
                $i++;
            }
        ?>
    </tbody>
</table>
