欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

GridVIew标题不换行

程序员文章站 2022-06-07 19:34:19
...

 <asp:GridView runat="server" BackColor="White" BorderColor="#009fef" style=" word-break:keep-all " 
                    BorderStyle="Solid" BorderWidth="1px"   CellPadding="4">
                    <FooterStyle BackColor="White" BorderColor="#009fef"  ForeColor="#ff0000" BorderWidth="1px" />
                    <RowStyle BackColor="White" Height="20px" HorizontalAlign="center" BorderColor="#009fef" BorderWidth="1px"  BorderStyle="Solid"  ForeColor="#002C6F" />                 
                    <AlternatingRowStyle BackColor="#F1F9FE" Height="20px" BorderColor="#009fef" BorderStyle="Solid" />
                    <SelectedRowStyle BackColor="#009999" Height="20px" Font-Bold="True" BorderColor="#009fef" ForeColor="#CCFF99"  BorderWidth="1px"  BorderStyle="Solid" />
                    <PagerStyle BackColor="#99CCCC" Height="20px" ForeColor="#003399" HorizontalAlign="Left" BorderColor="#009fef" BorderStyle="Solid"/>
                    <HeaderStyle Wrap="False"  BackColor="#7BADC4"  BorderColor="#009fef" Height="25px"  Font-Bold="True" ForeColor="#003F85" BorderWidth="1px" />
                </asp:GridView>

 关键是这两句

style=" word-break:keep-all " 和Wrap="False"
相关标签: ASP