ydn-js origin

YUI version 2.6.0

Extracting raw data from a <table> using YAHOO.util.DataSource

DataSource supports using a table in markup as its source of truth. If all you need is the data from the table, you can create a "pass-thru" DataSource instance to leverage the DOM walking and parsing routines inside.

In this example, a markup table will be parsed into an array named data.

(click the load button)
Table in markup with data in it
Due Date Account Number Quantity Amount Due
1/23/1999 29e8548592d8c82 12 $150.00
5/19/1999 83849 8 $60.00
8/9/1999 11348 1 -$34.99
1/23/2000 29e8548592d8c82 10 -$1.00
4/28/2000 37892857482836437378273 123 $33.32
1/23/2001 83849 5 -$15.00
9/30/2001 224747 14 $56.78