I need to hide a particular column in the HTML table when the page loads. I used ngOnInit() to hide the column. But it works only for the <th>
and not for <td>
.
But, when I used in click function it works for both <th>
and <td>
.
How can I achieve this?
this is my code used in ngOnInit
ngOnInit() {
$('td:nth-child(19),#tr1 th:nth-child(8)').hide();
}