<table>
    <caption>
        HSG   <button type="button" class="btn btn-xs blue addInvRow" id="invhsg" data-tableName="hsg" 
                      data-hus="0" data-itr="{$hsgCount}"> <i class="fa fa-plus"></i> </button>
    </caption>

    <tbody  id="hsgDiv">
        {if $hsgCount > 0 }   
        <tr>
            <th class="wds8" > Date  </th>  
            <th class="wds8" > Uterus </th>
            <th class="wds8" > R.tube  </th>  
            <th class="wds8">L.tube  </th>  
            <th class="wds8" > Smear  </th> 
            <th class="wds8" > Notes   </th> 
            <th class="wds2">   </th> 
        </tr>
        {/if}

        {foreach $hsgs as $hsg}
        <tr> 
            <td>
                <input type="text" class="form-control datepicker updateElement txtc" 
                       data-tableName="hsg" data-colName="sdate" data-id="{$hsg->id}" value="{$hsg->sdate}"/>
            </td> 
            <td>
                <input type="text" class="form-control updateElement" 
                       data-tableName="hsg" data-colName="uterus" data-id="{$hsg->id}" value="{$hsg->uterus}"/>
            </td>
            <td>
                <input type="text" class="form-control updateElement"  data-tableName="hsg"
                       data-colName="rtube" data-id="{$hsg->id}" value="{$hsg->rtube}"/>
            </td>
            <td>
                <input type="text" class="form-control updateElement"  data-tableName="hsg"
                       data-colName="ltube" data-id="{$hsg->id}" value="{$hsg->ltube}"/>
            </td>
            <td>
                <input type="text" class="form-control updateElement"  data-tableName="hsg"
                       data-colName="smear" data-id="{$hsg->id}" value="{$hsg->smear}"/>
            </td>
            <td>
                <input type="text" class="form-control updateElement"  data-tableName="hsg"
                       data-colName="notes" data-id="{$hsg->id}" value="{$hsg->notes}"/>
            </td>
            <td>
                <a class="btn grey-cascade btn-xs deletemsgEX2" data-id="{$hsg->id}" 
                   data-link="{$controllname}"  data-fn="del" data-tableName="hsg" data-colName="del">
                    <i class="fa fa-times"></i> </a>
            </td>
        </tr>
        {/foreach}
    </tbody>
</table>
