<style>
    .table,
    .td,
    .th {
        border: 1px solid black;
        text-align: left;
    }

    .table {

        width: 100%;
    }

    .th,
    .td {
        border: 1px solid black;
        padding: 5px;
    }
</style>

<div style="display:block; width: 100%;">

    <?php foreach ($productos as $row) : ?>

        <h3 style="text-align: center; display:block; width: 100%;"><?= $row['nombre'] ?></h3>

        <table width="100%" border="1" style="border: 1px solid black; border-collapse: collapse;">
            <thead>
                <tr style="background-color: #2A2F5B;">
                    <th style="color: white;">Descripci¨Žn</th>
                    <th style="color: white;" width="20%">Precio</th>
                </tr>
            </thead>
            <tbody>
                <?php foreach ($row['productos'] as $pro) :  ?>
                    <tr>
                        <td style="text-align: left;"><?= $pro['descripcion'] ?></td>
                        <td style="text-align: right;"><?= $pro['tarifa'] ?></td>
                    </tr>
                <?php endforeach; ?>
            </tbody>
        </table>

        <?php foreach ($row['subcategorias'] as $row1) : ?>

            <table width="100%" border="1" style="border: 1px solid black; border-collapse: collapse;">
                <thead>
                     <tr style="background-color: #ABC4E3;">
                        <th style="color: #000"><?= $row1['subcategoria'] ?></th>
                    </tr>
                    <tr style="background-color: #2A2F5B;">
                        <th style="color: white;">Descripci¨Žn</th>
                        <th style="color: white;" width="20%">Precio</th>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach ($row1['productos'] as $pro) :  ?>
                        <tr>
                            <td style="text-align: left;"><?= $pro['descripcion'] ?></td>
                            <td style="text-align: right;"><?= $pro['tarifa'] ?></td>
                        </tr>
                    <?php endforeach; ?>
                </tbody>
            </table>

        <?php endforeach; ?>
        <br><br>

    <?php endforeach; ?>

</div>