I am creating a runtime table which is taking values from the database, but the problem is that the all the rows of database table is showing in one column when running on browser, how to divide the data in two columns .
the code is shown below which is presenting the data in one column....
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("Data Source=SWATI;Initial Catalog=jwellerydesign;Integrated Security=True");
con.Open();
SqlCommand com = new SqlCommand("select * from category", con);
SqlDataReader dr = com.ExecuteReader();
Table tb = new Table();
while (dr.Read())
{
string a = dr.GetInt32(0).ToString();
TableRow tr = new TableRow();
ImageButton img = new ImageButton();
TableCell td = new TableCell();
img.ToolTip = dr.GetString(1);
img.CommandArgument = a;
img.Command += new CommandEventHandler(click);
string filename = dr.GetString(2);
img.ImageUrl = filename;
img.ImageAlign = 0;
td.Controls.Add(img);
td.Height = Unit.Pixel(150);
td.Width = Unit.Pixel(150);
tr.Controls.Add(td);
tb.Controls.Add(tr);
}
Panel1.Controls.Add(tb);
}
how to show same table data in two columns ???