<table class="table table-striped table-hover table-bordered" >
    <thead>
        <tr>
            <th> # </th>
            <th> For </th>
            <th> Disease</th>
            <th> Notes</th>
        </tr>
    </thead>
    <tbody>

        {assign var=i value=1}
        {foreach $allpastmedical as $myallpastmedical}
        <tr>
            <td>{$i} </td>
            <td>{if $myallpastmedical->for_husband == 1 }  Husband {else} Wife {/if} </td>
            <td> {$myallpastmedical->diseasename}</td>
            <td> {$myallpastmedical->medicalnote} </td>

        </tr>

        {capture assign=i}{$i+1}{/capture}
        {/foreach}

    </tbody>

</table>