repeater的问题~求助

来源:百度知道 编辑:UC知道 时间:2024/06/21 02:37:01
如何使repeater绑定的数据垂直显示?现在是横的
代码如下
后台: {
if (!IsPostBack)
{
DataTable a = new DataTable();
a.Columns.Add("name", typeof(string));
//a.Columns.Add("id", typeof(int));

DataRow x;
for (int i = 1; i < 5; i++)
{
x = a.NewRow();
x[0] = "a";
x[1] = i;
a.Rows.Add(x);
}
reoerte1.DataSource = a;
reoerte1.DataBind();
}
前台:
<%#DataBinder.Eval(Container.DataItem,"name") %>
<%#DataBinder.Eval(Container.DataItem,"id") %>

要想横行显示,就把前台用html语句布局一下,让它横向就可以了
repeater的显示状态全都是前途html控制的,后台控制不了,后台只是绑定而已

加<br> 或者画表格