1
Answer

color alternate rows in a table

priya

priya

9y
959
1
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)