我的列表视图太宽了。无论我将宽度标签放在哪里(使用 Listview 本身,在表格内。我应该把它们放在哪里?我的代码如下:我希望整个表格的宽度不超过 850 像素。
<asp:ListView ID="ListView1" runat="server" EnableViewState = "true" Visible="true" wra>
<LayoutTemplate>
<table cellpadding="1" width="850px" border="1" runat="server" id="tblProducts" >
<tr id="Tr1" runat="server">
<th id="Th1" runat="server">
Field Name
</th>
<th id="Th2" runat="server">
Type
</th>
<th id="Th3" runat="server">
XML Path
</th>
<th id="Th4" runat="server">
Vendor Path
</th>
<th id="Th5" runat="server">
Status
</th>
<th id="Th6" runat="server">
Comments
</th>
<th id="Th7" runat="server">
Edit
</th>
<th id="Th8" runat="server">
Forms
</th>
<th id="Th9" runat="server">
CU Specific
</th>
</tr>
<tr runat="server" id="itemPlaceholder" />
</table>
<asp:DataPager runat="server" ID="DataPager1" PageSize="50">
<Fields>
<asp:NumericPagerField ButtonCount="10" CurrentPageLabelCssClass="CurrentPage" NumericButtonCssClass="PageNumbers"
NextPreviousButtonCssClass="PageNumbers" NextPageText=" Next " PreviousPageText=" Previous " />
</Fields>
</asp:DataPager>
</LayoutTemplate>
<ItemTemplate>
<tr id="Tr2" runat="server">
<td>
<asp:Label ID="FieldName" runat="Server" Text='<%#Eval("FLD_NM") %>'/>
</td>
<td>
<asp:Label ID="Type" runat="Server" Text='<%#Eval("DATA_TYPE_CD") %>' />
</td>
<td>
<asp:Label ID="XMLPath" runat="Server" Text='<%#Eval("WS_XML_PATH_TX") %>' />
</td>
<td>
<asp:Label ID="VendorPath" runat="Server" Text='<%#Eval("FLD_NM") %>' />
</td>
<td>
<asp:DropDownList ID="Status" runat="Server" />
</td>
<td>
<asp:TextBox ID="Comments" runat="Server" MaxLength="100" />
</td>
<td>
<asp:LinkButton ID="EditButton" runat="Server" Text="Edit" CommandName="Edit" />
</td>
<td>
<asp:Label ID="Forms" runat="Server" Text='<%#Eval("FLD_NM") %>' />
</td>
<td>
<asp:Label ID="CUSpecific" runat="Server" Text='<%#Eval("FLD_NM") %>' />
</td>
</tr>
</ItemTemplate>
<EditItemTemplate>
<tr style="background-color: #ADD8E6">
<td>
<asp:LinkButton ID="UpdateButton" runat="server" CommandName="Update" Text="Update" />
<asp:LinkButton ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" />
</td>
<td>
<asp:TextBox ID="FieldName" runat="server" Text='<%# Bind("FLD_NM") %>' MaxLength="50" /><br />
</td>
<td>
<asp:TextBox ID="DataType" runat="server" Text='<%# Bind("DATA_TYPE_CD") %>' MaxLength="50" /><br />
</td>
</tr>
</EditItemTemplate>
</asp:ListView>