
here two textboxes are not aligned center..so i want to give margin-left to that textbox..but that textboxes are coming dynamically from javascript..
Here is my code:
<table class="table" id="table1">
<thead>
<tr>
<th style="padding-left: 115px;">No of tables</th>
<th>
<div class="col-lg-1"></div>
No of person
</th>
</tr>
</thead>
<tbody>
<tr class="success">
<td style="padding-left: 145px;">
1
</td>
<td>
<div class="col-lg-4"></div>
<div class="col-lg-5">
<input type="text" class="form-control uniform-input text" required="true">
</div>
</td>
</tr>
<tr class="error">
<td style="padding-left: 145px;">
2
</td>
<td>
<div class="col-lg-4"></div>
<div class="col-lg-5">
<input type="text" class="form-control uniform-input text" required="true">
</div>
</td>
</tr>
:
<tr class="info">
<td style="padding-left: 145px;">
7
</td>
<td>
<div class="col-lg-4"></div>
<div class="col-lg-5">
<input type="text" class="form-control uniform-input text" required="true">
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<br />
<br />
<button class="btn btn-primary" href="#" onclick="addRow();">Add More</button>
</div>
</div>
JAVAscript :: Function Addrow()::
<script language="javascript" type="text/javascript">
var i=1;
function addRow()
{
var tbl = document.getElementById('table1');
var lastRow = tbl.rows.length;
var iteration = lastRow - 1;
var row = tbl.insertRow(lastRow);
var firstCell = row.insertCell(0);
var secondCell = row.insertCell(1);
var el = document.createElement('input');
var e2 = document.createElement('input');
el.type = 'text';
el.name = 'name_' + i;
el.id = 'name_' + i;
el.size = 15;
el.maxlength = 15;
firstCell.appendChild(el);
e2.type = 'text';
e2.name = 'name_' + i;
e2.id = 'name_' + i;
e2.size = 15;
e2.maxlength = 15;
secondCell.appendChild(e2);
// alert(i);
i++;
frm.h.value=i;
// alert(i);
}
</script>
I already tried e1.style.marginLeft="88px"; and also tried to create one class , give margin-left in that class but It also not working..Please help me..
Again I want to say th problem: to give margin that textbox which create dynamically from javascript....Thanks