如何删除jQuery UI对话框中的额外空间

时间:2016-07-21 11:00:04

标签: javascript jquery html jquery-ui jquery-ui-dialog

这是我的对话框

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 <br><div>

内没有Sheet(strSourceSheet)

enter image description here

我怎样才能消除这个对这个额外间距的无能为力?

2 个答案:

答案 0 :(得分:0)

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

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

答案 1 :(得分: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>";
}

&GT;