Sumit Rajguru

Sumit Rajguru

  • 1.3k
  • 408
  • 40.1k

Hiding a <td> depending on the Condition

Aug 29 2018 10:47 AM
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)