for (int i = 1; i < dt.Rows.Count-1; i++)
{
System.Web.UI.HtmlControls.HtmlTableRow tr1 = new System.Web.UI.HtmlControls.HtmlTableRow();
tr1.Height = "25"; tr1.Align = "left"; tr1.VAlign = "middle"; tr1.BgColor = "#ffffff";
foreach (DataColumn dc_detail in dt.Columns)
{
System.Web.UI.HtmlControls.HtmlTableCell td1 = new System.Web.UI.HtmlControls.HtmlTableCell();
td1.Align = "center"; td1.Align = "center";
if (dt.Columns[dc_detail.Caption].ToString() == "Month_Rating")
{
td1.InnerHtml = dt.Rows[i][dc_detail].ToString() == "" ? "" : Convert.ToDouble(dt.Rows[i][dc_detail].ToString()) > 60 ? dt.Rows[i][dc_detail].ToString() : string.Format("<font color=\"red\">{0}</font>", dt.Rows[i][dc_detail].ToString());
}
else
{
td1.InnerHtml = dt.Rows[i][dc_detail].ToString();
}
tr1.Cells.Add(td1);
tb1.Rows.Add(tr1);
}
}
{
System.Web.UI.HtmlControls.HtmlTableRow tr1 = new System.Web.UI.HtmlControls.HtmlTableRow();
tr1.Height = "25"; tr1.Align = "left"; tr1.VAlign = "middle"; tr1.BgColor = "#ffffff";
foreach (DataColumn dc_detail in dt.Columns)
{
System.Web.UI.HtmlControls.HtmlTableCell td1 = new System.Web.UI.HtmlControls.HtmlTableCell();
td1.Align = "center"; td1.Align = "center";
if (dt.Columns[dc_detail.Caption].ToString() == "Month_Rating")
{
td1.InnerHtml = dt.Rows[i][dc_detail].ToString() == "" ? "" : Convert.ToDouble(dt.Rows[i][dc_detail].ToString()) > 60 ? dt.Rows[i][dc_detail].ToString() : string.Format("<font color=\"red\">{0}</font>", dt.Rows[i][dc_detail].ToString());
}
else
{
td1.InnerHtml = dt.Rows[i][dc_detail].ToString();
}
tr1.Cells.Add(td1);
tb1.Rows.Add(tr1);
}
}