<table class="table table-hover portlet light bg-inverse rtl" id="repTable" style="width: 100%;">
    <thead>
        <tr>
            <th rowspan="2" style="width: 10px !important;">#</th>
            <th rowspan="2">  رقم  المريض</th>
            <th rowspan="2">  اسم المريض</th>
            {foreach $locations as $location}
            <th colspan="{$location.floorsCount}">    {$location.locationName}</th>
            {/foreach}
        </tr>

        <tr>
            {foreach $locations as $location}
            {foreach $location.floors as $floor}
            <th>    {$floor.floorName}</th>
            {/foreach}
            {/foreach}
        </tr>
    </thead>
    <tbody>
        {assign var="i" value="1"}
        {foreach $patients as $patient}
        <tr>
            <td>{$i}</td>
            <td> {$patient.statusno}</td>
            <td> {$patient.wifename} - {$patient.husdandname}</td>
            {foreach $patient.records as $record}
            <td style="direction: ltr;">    {$record}</td>
            {/foreach}
        </tr>
        {assign var="i" value={$i+1}}
        {/foreach}
    </tbody>
</table>