Home  >  Article  >  Web Front-end  >  如何让Datagrid的数据列居左显示?_html/css_WEB-ITnose

如何让Datagrid的数据列居左显示?_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-21 09:48:391242browse

样式设置得不起作用,Datagrid的数据列没有居左显示,请问样式应该如何修改?

<style type="text/css">.tableList Class1{text-align:left}    </style>




<asp:DataGrid ID="DataGrid1" runat="server" CssClass="tableList"   PagerStyle-Visible="False" AllowPaging="True"  AutoGenerateColumns="False">                                    <HeaderStyle CssClass="thead"></HeaderStyle>                                    <Columns>                                        <asp:BoundColumn Visible="False" DataField="Id">                                            <ItemStyle Wrap="False"></ItemStyle>                                        </asp:BoundColumn>                                                            <asp:TemplateColumn HeaderText="类型">																						<HeaderStyle></HeaderStyle>																						<ItemStyle Wrap="False" CssClass="Class1"></ItemStyle>																						<ItemTemplate>																							<%# ShowType(DataBinder.Eval(Container.DataItem, "字段1").ToString())%>																						</ItemTemplate>																					</asp:TemplateColumn>                 			                                              </Columns>          </asp:DataGrid>

回复讨论(解决方案)

.tableList .Class1

.tableList .Class1


试过了,不起作用

这个你最好是看看生成的html代码是什么样子的,毕竟css只是客户端的东西

或者干脆 
.tableList td{text-align:left}

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn