Jump to content

Delete all rows


bijan

Recommended Posts

What you could do is add this to your 'table' tag.

id="tblRowDel"

And to access how many table rows there are, you do this:

x=document.getElementById("tblRowDel")x=x.getElementsByTagName("td")y=x.length

Now, you can use Y with your for loop. Y contains the number of TD's in your table. :)

Link to comment
Share on other sites

What you could do is add this to your 'table' tag.
id="tblRowDel"

And to access how many table rows there are, you do this:

x=document.getElementById("tblRowDel")x=x.getElementsByTagName("td")y=x.length

Now, you can use Y with your for loop. Y contains the number of TD's in your table. :)

replace td with trtd are the cells tr are the rows which you asked for :)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...