我的页面的 HTML 表格代码在这里。
它不会自动调整。我需要删除多余的空格,它们之间只需要保留 5% 的空间。
<table width="95%">
<tr>
<td align="left">
<asp:Button ID="btnTargetVsActual" runat="server" Text="Target Vs Actual" CssClass="selectedButton"
Width="200px" OnClientClick="javascript:return SetFilterAndChart('ctl00_CPHFFR_btnTargetVsActual');" />
<asp:Button ID="btnKPIActivities" runat="server" Text="KPI Activities" CssClass="unSelectedButton"
Width="200px" OnClientClick="javascript:return SetFilterAndChart('ctl00_CPHFFR_btnKPIActivities');" />
</td>
</tr>
<tr>
<td style="width: 100%;white-space: nowrap;">
<asp:Panel ID="pnlMain" runat="server" BorderColor="Navy" BorderWidth="2">
<asp:UpdatePanel runat="server" ID="UpdFilters" UpdateMode="Conditional">
<ContentTemplate>
<asp:Panel ID="pnlFilterCriteria" runat="server" GroupingText="Filter Criteria" BorderWidth="1">
<table width="100%">
<tr>
<td align="center" id="tdlblYear">
<asp:Label ID="lblYear" runat="server" Text="Year" CssClass="Label"></asp:Label>
</td>
<td align="center" id="tdlblMonth">
<asp:Label ID="lblMonth" runat="server" Text="Month" CssClass="Label"></asp:Label>
</td>
<td align="center" id="tdlblCountry">
<asp:Label ID="lblCountry" runat="server" Text="Country" CssClass="Label"></asp:Label>
</td>
<td align="center" id="tdlblDivision">
<asp:Label ID="lblDivision" runat="server" Text="Team" CssClass="Label"></asp:Label>
</td>
<td align="center" id="tdlblPosition">
<asp:Label ID="lblPosition" runat="server" Text="Position" CssClass="Label"></asp:Label>
</td>
<td align="center" id="tdlblClass" >
<asp:Label ID="lblClass" runat="server" Text="Class" CssClass="Label"></asp:Label>
</td>
<td align="center" id="tdlblSpecialty">
<asp:Label ID="lblSpecialty" runat="server" Text="Specialty" CssClass="Label"></asp:Label>
</td>
</tr>
<tr style ="white-space: nowrap;">
<td align="left" valign="top">
<asp:DropDownList ID="ddlYear" runat="server" CssClass="dropDownList" Width="98%" >
</asp:DropDownList>
</td>
<td align="left" valign="top">
<asp:Panel ID="pnlMonth" ScrollBars="Auto" runat="server" Height="95px" BorderColor="#003973"
BorderWidth="1px" Width="95%">
<asp:CheckBoxList ID="cblMonth" runat="server" CssClass="checkboxlist">
</asp:CheckBoxList>
</asp:Panel>
</td>
<td align="left" valign="top">
<asp:DropDownList ID="ddlCountry" runat="server" CssClass="dropDownList" Width="95%"
AutoPostBack="true">
</asp:DropDownList>
</td>
<td align="left" valign="top">
<asp:Panel ID="pnlDivision" ScrollBars="Auto" runat="server" Height="95px" BorderColor="#003973"
BorderWidth="1px" Width="95%">
<asp:CheckBoxList ID="cblDivision" runat="server" CssClass="checkboxlist" AutoPostBack="true">
</asp:CheckBoxList>
</asp:Panel>
</td>
<td align="left" valign="top">
<asp:UpdatePanel ID="upPosition" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Panel ID="pnlPosition" ScrollBars="Auto" runat="server" Height="95px" BorderColor="#003973"
BorderWidth="1px" width="95%">
<asp:CheckBoxList ID="cblPosition" runat="server" CssClass="checkboxlist">
</asp:CheckBoxList>
</asp:Panel>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="cblDivision" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
</td>
<td align="left" valign="top" >
<center>
<asp:Panel ID="pnlClass" runat="server" Height="95px" BorderColor="#003973" BorderWidth="1px"
Width="35%">
<asp:CheckBoxList ID="cblClass" runat="server" CssClass="checkboxlist">
</asp:CheckBoxList>
</asp:Panel>
</center>
</td>
<td align="left" valign="top">
<asp:UpdatePanel ID="upSpecialty" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Panel ID="pnlSpecialty" ScrollBars="Auto" runat="server" Height="95px" BorderColor="#003973"
BorderWidth="1px" >
<asp:CheckBoxList ID="cblSpecialty" runat="server" CssClass="checkboxlist">
</asp:CheckBoxList>
</asp:Panel>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="cblDivision" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
</td>
</tr>
</table>
</asp:Panel>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddlCountry" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
<table width="100%">
<tr>
<td align="center" style="padding: 5px;">
<asp:Button ID="btnGo" runat="server" Text="GO" CssClass="button" />
</td>
</tr>
</table>
<table id="tblTargetVsActual" width="100%" runat="server">
<tr>
<td align="center">
<div id="divSellingDays">
</div>
</td>
</tr>
<tr>
<td align="center">
<div id="divFrequency">
</div>
</td>
</tr>
<tr>
<td align="center">
<div id="divCoverage">
</div>
</td>
</tr>
</table>
<table id="tblKPIActivities" width="100%" runat="server">
<tr>
<td style="width: 50%;" valign="top">
<div id="divCallVolume">
</div>
</td>
<td style="width: 50%;" valign="top">
<div id="divFrequencyByDoctor">
</div>
</td>
</tr>
<tr>
<td style="width: 50%;" valign="top">
<div id="divCallVolumeByClass">
</div>
</td>
<td style="width: 50%;" valign="top">
<div id="divDoctorCoverageByClass">
</div>
</td>
</tr>
<tr>
<td style="width: 50%;" valign="top">
<div id="divFrequencyByClass">
</div>
</td>
<td style="width: 50%;" valign="top">
<div id="divDailyCallRate">
</div>
</td>
</tr>
</table>
</asp:Panel>
</td>
</tr>
</table>
并生成此代码的输出,如下所示
我需要消除这些差距并将空间分配给“位置”和“专业”。
提前致谢!--------------编辑----- CSS规则
.dropDownList
{
font-size: 11px;
font-style: normal; /*font-family: Verdana, Arial, Helvetica, sans-serif;*/
font-family: Arial;
color: Navy;
border: Solid;
border-color: Navy;
border-width: 1px;
width: 150px;
line-height: 12px;
height: 20px;
vertical-align: top;
}
.checkboxlist
{
font-size: 11px;
font-style: normal;
/*font-family: Verdana, Arial, Helvetica, sans-serif;*/
font-family: Arial;
}