[英]Wrap header doesn't work in IE
目前,我正在asp.net中進行編程。 我有69ish列和250.000條記錄的gridview。 我在gridview上有分頁,每頁顯示15條記錄。
現在,為了能夠添加更多記錄,我想包裝標題文本。
For example: | Project Funds in USD | (should it be) --- (what I have now) | Project |
Funds
in USD
在我的gridview的標題樣式中,我嘗試了幾種方法:
Wrap="false";
white-space:nowrap;
我還注意到,當我在本地運行Web應用程序時,IE會“讀取”它的內容並將其包裹起來,就像我希望包裹它一樣。 但是,當我將其發布到公司的Web服務器時,它卻嚇壞了,不管他想要做什么。
<div style="overflow: auto; width: auto; height: auto; margin-top: 5px; clear:both">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" AllowSorting="True"
DataKeyNames="iol_id" CellPadding="4" ForeColor="#333333"
OnSorting="GridView1_Sorting">
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" HorizontalAlign="Center"/>
<Columns>
<asp:BoundField DataField="Rank" HeaderText="Rank"
SortExpression="Rank" ItemStyle-Wrap="false">
<ItemStyle Wrap="False"></ItemStyle>
</asp:BoundField>
<asp:BoundField DataField="OI_IV_Status" HeaderText="OI IV Status"
SortExpression="OI_IV_Status" ItemStyle-Wrap="false">
<ItemStyle Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="Supplier_Code" HeaderText="Supplier Code"
SortExpression="Supplier_Code" ItemStyle-Wrap="false" >
<ItemStyle Wrap="False"></ItemStyle>
</asp:BoundField>
<asp:BoundField DataField="Billing_Period" HeaderText="Billing Period"
SortExpression="Billing_Period" ItemStyle-Wrap="false" >
<ItemStyle Wrap="False"></ItemStyle>
</asp:BoundField>
<asp:BoundField DataField="Invoice_Type" HeaderText="Invoice Type"
SortExpression="Invoice_Type" ItemStyle-Wrap="false" >
<ItemStyle Wrap="False"></ItemStyle>
</asp:BoundField>
<asp:BoundField DataField="Invoice_Number" HeaderText="Invoice Number"
SortExpression="Invoice_Number" ItemStyle-Wrap="false" >
<ItemStyle Wrap="False"></ItemStyle>
</asp:BoundField>
<asp:BoundField DataField="Bussiness" HeaderText="Bussiness"
SortExpression="Bussiness" ItemStyle-Wrap="false">
<ItemStyle Wrap="False"></ItemStyle>
</asp:BoundField>
<asp:BoundField DataField="Payer_LE_Code" HeaderText="Payer LE Code"
SortExpression="Payer_LE_Code" ItemStyle-Wrap="false">
<ItemStyle Wrap="False"></ItemStyle>
</asp:BoundField>
<asp:BoundField DataField="Payer_LE_Name" HeaderText="Payer LE Name"
SortExpression="Payer_LE_Name" ItemStyle-Wrap="false" >
<ItemStyle Wrap="False"></ItemStyle>
</asp:BoundField>
...
</Columns>
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Left" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" HorizontalAlign="Center" Wrap="false" />
<EditRowStyle BackColor="#999999" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
</asp:GridView>
</div>
如果你們需要任何其他代碼,請問我;)
按F12鍵進入開發人員工具。 在本地和Intranet部署中檢查查看模式。 我感覺IE會迫使您進入Intranet上的兼容模式。 您可以覆蓋此行為,但可以通過在下拉列表中選擇標准和兼容模式來仔細檢查,以查看是否存在此問題。
編輯:如果這是您現在所說的問題,則是html需要以下meta標簽:
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
此meta標簽必須是標頭中的第一個標簽
white-space:nowrap
是要確保標頭不要換行,這與您嘗試執行的操作相反。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.