Hide column from dynamic table

Hide column from dynamic table

I have created a table using some codebehind logic. When a button is clicked on the page the table is shown. What i would like to do is hide certain columns. So far using the code

  
  1.     <script type="text/javascript">
  2.         $(document).ready(function () {
  3.             $('#<%= btnHide.ClientID %>').click(function () {
  4.                 $('table#tblName td:nth-child(1)').hide();
  5.             });
  6.         });
  7.     </script>
hides the columns as required when i have the table created at design time but using the same code as above with a dynamically created table doesnt seem to hide any columns?

Could anyone help?

Thanks