I got a jquery modal dialog which i load a jquery datatable inside. I cant make the dialog to display at the center (currently it keeps to the right)
Any idea what will be the possible cause & solution?
I tried position: center, but it dint work.
My script is like this:
// Dialog for food details
var $detaildialog;
$detaildialog = $('#detaildialog').dialog({
autoOpen: false,
title: 'Food Details',
modal: true,
position: 'center',
width: 'auto',
height: 'auto'
});
//Call Details action to display the food details
var url = '/Food/Details?cid=' + id;
//Use .load callback function to ensure details is loaded before dialog open
$detaildialog.load(url, function () {
$('#loading').hide();
$detaildialog.dialog('open');
});
And just showing part of my datatable html here:
<div id="tableplaceholder">
<table id="stocktable" class="pretty">
<thead>
<tr>
<th>
Name
</th>
<th>
Amount
And css:
#tableplaceholder
{
width: 100%;
}
Need help here… Appreciate any feedback……
although I not sure why, but after I fixed the dialog div width, the dialog is centered. Just post it here in case anyone having the same situation. Thanks!