priya

priya

  • 2k
  • 32
  • 8.1k

color alternate rows in a table

Mar 29 2015 7:10 AM
this is for color alternate row............. 
  
public void delcoloralternaterow()
{
mshtmlTable table = null;
mshtmlTableRow row = null;
mshtmlTableCell cell = null;
GetTableElement(out table, out row, out cell);
if (table != null)
{
try
{
HtmlElement table1 = getTableHTMLElement();
int count = 0;
foreach (HtmlElement row1 in table1.GetElementsByTagName("tr"))
{
if (count % 2 == 0)
{
row1.Style = "background-color: none";
}
count++;
}
}
catch (Exception ex)
{
throw new HtmlEditorException("Unable to colour the row", "Colour row", ex);
}
}
 
i just want to Alternate row colors should work on the rows below cursor ..
 
help me out to do this... 
 
 

 

Answers (1)