2016-07-21 56 views
0

这里是我的对话框如何删除jQuery UI的对话框内多余的空间

enter image description here

我想删除或删除对话框内的多余的空格。我怎样才能实现它?

这里额外的细节我HTML

<div id="beneficiaries_window"> 
    <?php 
    $sql1 = "SELECT * FROM beneficiary WHERE id = '$id'"; 
    $result1 = mysql_query($sql1); 
    ?> 
    <table style="border: 2px solid black;margin:auto;"> 
    <tr> 
     <th><center>Name<center></th> 
     <th><center>Action</center></th> 
    </tr> 
    <?php    
    while($row1 = mysql_fetch_array($result1)){ 
     echo "<tr class='beneficiaries_rows' id='".$row1['id']."'>"; 
     echo "<td>".$row1['name']."</td>"; 
     echo "<td>"; 
     echo "<button class='edit_beneficiaries'>EDIT</button>"; 
     echo "<button class='del_beneficiaries'>X</button>"; 
     echo "</td><br/>"; 
     echo "</tr>"; 
    } 
    ?> 
    </table> 
    </div> 
    <button class="beneficiaries" name="beneficiaries">Beneficiaries</button> 

jQuery脚本

jQuery("#beneficiaries_window").dialog({ 
    modal: true, 
    resizable: false, 
    draggable: false, 
    autoOpen: false, 
    buttons:[{ 
    text: "Close", 
    click: function(){ 
     jQuery(this).dialog("close"); 
    } 
    }] 
}); 

//beneficiaries open dialog 
jQuery(".beneficiaries").click(function(event){ 
    jQuery("#beneficiaries_window").dialog("open"); 
    event.preventDefault(); 
    }); 

但在我萤火我看到这个<br>'s但他们是<div>的内部没有<br>

enter image description here

我怎样才能消除这个即时通讯关于这个额外的间距?

回答

0

它,因为这种额外的间距的原因<br>

<?php    
while($row1 = mysql_fetch_array($result1)){ 
    echo "<tr class='beneficiaries_rows' id='".$row1['id']."'>"; 
    echo "<td>".$row1['name']."</td>"; 
    echo "<td>"; 
    echo "<button class='edit_beneficiaries'>EDIT</button>"; 
    echo "<button class='del_beneficiaries'>X</button>"; 

    echo "</td><br/>";   <----THIS <br/> make the extra spacing 

    echo "</tr>"; 
} 

?>

0
$('#div_id').dialog({ 
     title : 'Add User', 
     position: { my: "center", at: "center", of: window }, 
     width : 1000, 
     height : 500, 
     modal : true, 
     closeOnEscape: false 
    }); 

您可以定义宽度,高度,相应地定义宽度。

+0

我给我的高度** 150 **,但仍额外的间距仍然是他们即使我做到了** 20 **它给我滚动,但额外的空间仍然是他们的。 – reyjoel

+0

检查dom是否有一些与div一起填充。 –

+0

我明白了,先生,谢谢。我回应'
'这就是为什么它有额外的间距 – reyjoel