<button type="button" class="btn btn-xs blue fright" id="addnewRow" data-selectClass="{$table}" data-tableName="{$table}"><i class="fa fa-plus"></i> Add</button></td>
<input type="hidden" id="slctTbl" value="">
<table cellspacing="10" width="100%" id="dtAddTbl">
    <thead>
        <tr>
            <th>Name</th>
            <th>Delete</th>
        </tr>
    </thead>
    {assign var=i value=1}
    {foreach $alldata as $mydata}
    <tr>
        <td style="width: 100%">
            <a href="#" >

                <input type="text" class="form-control updateElementSelect" data-selectClass="{$table}" id="edtSlct" data-select2="yes" data-id="{$mydata->id}" data-colName="name" data-tableName="{$table}" value="{$mydata->name}"/>
            </a>
        </td>
        <td>
            <a class="delrow fa fa-times btn red fleft" data-colName="conditions" data-link="gyna" data-tableName="{$table}" data-fn="deldiagnosis" data-id="{$mydata->id}" ></a>
        </td>
    </tr>

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

</table>
