If you have a specific row count then you may try something like this...
for (int i = 0; i < Dt.Rows.Count; i++)
{
if (i == 5)
{
HtmlGenericControl div1 = new HtmlGenericControl("div");
div1.ID = div1 + i.ToString();
div1.InnerText = "First div created for 5 rows";
form1.Controls.Add(div1);
}
else if (i == 20)
{
HtmlGenericControl div2 = new HtmlGenericControl("div");
div2.ID = div2 + i.ToString();
div2.InnerText = "Second div created for 20 rows";
form1.Controls.Add(div2);
}
}