RE: HTML DOM Question About Table Size

  • From: "Ken Perry" <whistler@xxxxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Tue, 22 Mar 2011 21:43:51 -0400

Ok to get the last column and row is a bit twisted.  If you're on the
element that is the table element you can find the last row by doing this.

 

Elem.rows.length;

 

Now if you're looking for the longest columns last cell you have to loop
through all the rows and find the longest then check the last cell but if
your only looking for the last row  and last column then it would look like
this.

 

Elem.rows[elemn.rows.length].cells[elem.rows[elem.rows.length].cells.length]

 

Now I didn't test this but I know I have the logic right.

 

ken

 

From: programmingblind-bounce@xxxxxxxxxxxxx
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Homme, James
Sent: Tuesday, March 22, 2011 3:04 PM
To: programmingblind@xxxxxxxxxxxxx
Subject: HTML DOM Question About Table Size

 

Hi,

In Word, the cell and row information is available to screen readers, which
is why they can tell you that you are in the last row and last cell of a
table. This question isn't screen reader specific. If you are coding a web
page, can you get a script to figure out whether you are in the last row and
last cell of a table or not? If so, what properties do you check out?

 

Thanks.

 

Jim

 

  _____  

This e-mail and any attachments to it are confidential and are intended
solely for use of the individual or entity to whom they are addressed. If
you have received this e-mail in error, please notify the sender immediately
and then delete it. If you are not the intended recipient, you must not
keep, use, disclose, copy or distribute this e-mail without the author's
prior permission. The views expressed in this e-mail message do not
necessarily represent the views of Highmark Inc., its subsidiaries, or
affiliates.

Other related posts: