I need to reposition the jqgrid away from its default top left position. I have attempted some adjustments but they are not working as expected. Below is the code snippet for your review and suggestions:
Here is the HTML code snippet:
<div>
<table id="table" style="border-spacing: 7px 7px; margin-left: 5px">
<tr>
<td>
<input style="margin-left: 10px;" type="button" value="Add" id="btn_addusers" />
</td>
</tr>
</table>
<table id="users_grid" style="left: 300px">
</table>
</div>
And here is my JavaScript code snippet:
$(document).ready(function() {
$("#btn_addusers").click(function() {
$("#users_grid").clearGridData(true).trigger("reloadGrid");
$("#users_grid").jqGrid({
datatype: "local",
height: 'auto',
width: 'auto',
colNames: ['User ID', 'User Name'],
colModel: [
{ name: 'userid', width: 60 },
{ name: 'username', width: 120 }
],
caption: "Users in Private space"
});
var mydata = [
{ userid: "312171", username: "D, Gnana Xavier" },
{ userid: "311763", username: "Sangeetha" },
{ userid: "312185", username: "Amrutha" },
{ userid: "312186", username: "Ramesh" }
];
for (var i = 0; i <= mydata.length; i++)
$("#users_grid").jqGrid('addRowData', i + 1, mydata[i]);
});
});