1.假如下面有一个Gridview,

 <asp:GridView ID="GVData" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
                    BorderStyle="Solid" BorderWidth="1px" OnRowDataBound="GVData_RowDataBound" PageSize="15"
                    Width="100%" CssClass="gridview">
                    <PagerSettings Mode="NumericFirstLast" Visible="False" />
                    <PagerStyle BackColor="LightSteelBlue" HorizontalAlign="Right" />
                    <HeaderStyle BackColor="#006599" Font-Size="12px" ForeColor="White" Height="20px" />
                    <AlternatingRowStyle BackColor="WhiteSmoke" /> 

      <Columns>                      

                       <asp:BoundField DataField="Address" HeaderText="收货地址">
                              <ItemStyle HorizontalAlign="Left" />                --使包含这个属性的列居左边
                        </asp:BoundField> 

                       <asp:BoundField DataField="ShippingMobile" HeaderText="收货电话" /> --居中

     </Columns>
                    <RowStyle HorizontalAlign="Center" Height="25px" /> --使整个Gridview的行默认居中

 </asp:GridView>

相关文章:

  • 2021-12-13
  • 2022-01-20
  • 2022-01-08
  • 2021-06-17
  • 2022-12-23
  • 2021-10-27
  • 2021-11-20
  • 2022-12-23
猜你喜欢
  • 2021-07-13
  • 2022-12-23
  • 2021-07-19
  • 2022-12-23
  • 2021-10-03
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案