一、div居中
margin-left: auto;margin-right: auto;
<div style="width:960px ; margin-left: auto;margin-right: auto;" ></div>
二、table居中
margin:auto;
.searchclass { width:960px; min-height:80px; border-right:1px solid #000;border-bottom:1px solid #000; margin:auto; } .searchclass tr td { height:15px; border-left:1px solid #000;border-top:1px solid #000 }
<table class="searchclass"> <tr><td><asp:label id="Label9" Width="120px" runat="server">有效截止日期:</asp:label></td><td><asp:label id="lblTillDate" Width="120px" runat="server" ForeColor="#FF8080"></asp:label></td><td colspan="2"></td></tr> <tr><td> Check-in:<asp:dropdownlist id="lstFADD" Width="48px" runat="server" ></asp:dropdownlist></td> <td><asp:dropdownlist id="lstFAMMYY" Width="85px" runat="server"></asp:dropdownlist></td> <td>Nights :<asp:dropdownlist id="lstNights" Width="48px" runat="server" ></asp:dropdownlist></td> <td><asp:Button ID="btnsearch" runat="server" Text="查询" /><asp:Button ID="btnExcel" runat="server" Text="Export to Excel" /></td> </tr> <tr> <td colspan="2">开始时间: <asp:dropdownlist id="lstFADDFnestart" Width="48px" runat="server" ></asp:dropdownlist> <asp:dropdownlist id="lstFAMMYYFnestart" Width="85px" runat="server"></asp:dropdownlist> </td> <td colspan="2">截止时间: <asp:dropdownlist id="lstFADDFneend" Width="48px" runat="server" ></asp:dropdownlist> <asp:dropdownlist id="lstFAMMYYFneend" Width="85px" runat="server"></asp:dropdownlist> </td> </tr> <tr><td colspan="4"><asp:Button ID="btnsaveFne" runat="server" Text="Save"/></td></tr> </table>
时间: 2024-10-25 08:59:39