<table height=226 cellSpacing=0 cellPadding=0 width="80%" align=center border=0>
<tr>
<td><A href >北京市</A></td>
<td><A href >天津市</A></td>
<td><A href >上海市</A></td>
</tr>
<tr>
<td><A href >北京市</A></td>
<td><A href >天津市</A></td>
<td><A href >上海市</A></td>
</tr>
</table>
它原先html格式是这样的,
我现在用datalist这样写:
<asp:datalist id=ChinaArea runat="server" Width="80%" RepeatDirection="Horizontal" RepeatColumns="3" BorderWidth="0" CellSpacing="0" CellPadding="0" Height="226">
<ItemTemplate>
<table align=center>
<tr>
<td class=dian_line align=center><A href=><%#DataBinder.Eval(Container,"DataItem.Province")%></A></td>
</tr>
</table>
</ItemTemplate>
</asp:datalist>原先里面的省市是用一个<td></td>来显示,
用了datalist后变成用一个<table>来表示,
最关键是这样写出来的效果,并不能像html里面那样居中,
我是要实现一行显示三个省市,且居中,
请高手,参照那个html表格,用datalist或者repeater实现一个.
<tr>
<td><A href >北京市</A></td>
<td><A href >天津市</A></td>
<td><A href >上海市</A></td>
</tr>
<tr>
<td><A href >北京市</A></td>
<td><A href >天津市</A></td>
<td><A href >上海市</A></td>
</tr>
</table>
它原先html格式是这样的,
我现在用datalist这样写:
<asp:datalist id=ChinaArea runat="server" Width="80%" RepeatDirection="Horizontal" RepeatColumns="3" BorderWidth="0" CellSpacing="0" CellPadding="0" Height="226">
<ItemTemplate>
<table align=center>
<tr>
<td class=dian_line align=center><A href=><%#DataBinder.Eval(Container,"DataItem.Province")%></A></td>
</tr>
</table>
</ItemTemplate>
</asp:datalist>原先里面的省市是用一个<td></td>来显示,
用了datalist后变成用一个<table>来表示,
最关键是这样写出来的效果,并不能像html里面那样居中,
我是要实现一行显示三个省市,且居中,
请高手,参照那个html表格,用datalist或者repeater实现一个.
<headertemplate>
<table>
</headertemplate><ItemTemplate>
<td><%#DataBinder.Eval(Container,"DataItem.Province")%></td>
</ItemTemplate></footertemplate></table></footertemplate></asp:Datalist>datalist有一个itemstyle,设为center就可以了
<table align=center>
<HeaderTemplate>
<ItemTemplate>
<tr>
<td class=dian_line align=center><A href=><%#DataBinder.Eval(Container,"DataItem.Province")%></A></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
BorderWidth="0px" CellPadding="0" Height="226px" HorizontalAlign="Center">
ItemStyle HorizontalAlign="Center" VerticalAlign="Middle"></ItemStyle>
<ItemTemplate>
<A href="">
<%#DataBinder.Eval(Container,"DataItem.Province")%>
</A>
</ItemTemplate>
</asp:datalist>