Hi.
I have a data table from which I am trying to create a html table , which can be send in email.
I am able to get the data generated and mail being send, but the styles are not getting applied properly.
The table column names are different from the data column names. I am not able to add the html script tags here. Code is from one of the answers in : https://forums.asp.net/t/2117351.aspx?Alternate+row+colors+for+dynamically+built+html+table+in+C+
I have not used the first foreach loop , which loops the column names. I have manually put names for the initial TR.
int currRow = 1;
for (int loopCount = 0; loopCount < ds.Rows.Count; loopCount++)
{
mailBody.Append(
"<td>" + ds.Rows[loopCount]["FILE_NAME"] + " : " + ds.Rows[loopCount]["DESCRIPTION"] + "</td>" +
"<td>" + ds.Rows[loopCount]["FILE_DATE"] + "</td>" +
"<td>" + ds.Rows[loopCount]["PERIOD"] + "</td>" ) ;
mailBody.Append("</tr>");
}
mailBody.Append("</table>");
How to get the alternate colors for the rows ? Thanks