Below is my html table. In first table first tr first cell i have given csstdgreen to td.
and second cell have csstdgreen with rowspan 3.
I have to clear csstdgreen and rowspan and like to convert second table tr.
I have loop through table and check cell have csstdgreen and how many rowspan.
if cell have csstdgreen and rowspan then make first table like second table.
How i check css and rowspan in c# server side.I search google but not get.
//First Table
<table id="mytable" runat="server">
<tr class="csstablelisttd">
<td>09:00AM</td>
<td class="csstdgreen">00</td>
<td class="csstdgreen" rowspan="3">John</td>
</tr>
<tr class="csstablelisttd">
<td></td>
<td class="csstdgreen">15
</td>
</tr>
<tr class="csstablelisttd">
<td></td>
<td class="csstdgreen">15
</td>
</tr>
</table>
//Second Table
<table id="mytable" runat="server">
<tr class="csstablelisttd">
<td>09:00AM</td>
<td>00</td>
<td>John</td>
</tr>
<tr class="csstablelisttd">
<td></td>
<td>15
</td>
<td></td>
</tr>
<tr class="csstablelisttd">
<td></td>
<td class="csstdgreen">15
</td>
<td></td>
</tr>
</table>
//I m looping through table like this in server code.
for(int i = 0; i <= mytable.Rows.Count - 1; i++)
{
for(int j = 0; j <= mytable.Rows.Count - 1; j++)
{
//error in if conditon object refrence not set to an instance of an object
if(mytable.Rows[i].Cells[j].Attributes["csstdgreen"].Equals("csstdgreen"))
{
}
}
}
to Remove CssCalss
To Add CssClass