Is there a built in function to count number of rows in an html table?
Yes there is.
I have a feeling though your question really was meanht to be "what is the function to count number of rows in a html table?" isn't it?
research the TSL online help file (click F1 while in your editor) and look into the information provided for the tbl_* functions
Insanity: doing the same thing over and over again and expecting different results