3
Answers

Hiding a <td> depending on the Condition

Sumit Rajguru

Sumit Rajguru

6y
5.4k
1
I have a table structure as given below:
 
<table>
<tr>
<td id="td1"> </td>
<td id="td2"> </td>
<td id="td3"> </td>
<td id="td4"> </td>
</tr> 
</table>
 
I am checking some condition like:
 
if(a==2 || check == true)
 
I want to hide the "td3" if any one condition satisfies.
 
My code is in c#.
 
Need solution (in C# code behind or Jquery or Javascript) as soon as possible.
 
Thanx.
 
Note: I have already tried
 
document.getelementbyId("td3").style("display"= "none"),
document.getelementbyId("td3").display.hide();
td3.Attributes.add("style", "display:none")
Answers (3)