Below are two HTML tables. Each table contains row (tr) elements and each row contains data (td) elements.
Examples of selecting the tables using D3's .select() and .selectAll() are shown to the right.
1 | 2 |
3 | 4 |
a | b | c |
d | e | f |
g | h | i |
.select() and .selectAll() return arrays of arrays of DOM elements.
The elements of the latest .selectAll() are grouped according to its preceding select. Each group has a parentNode (the element of the preceding select).
If there isn't a preceding select, d3.select('html') is implied.
Further information on selections includes the API Reference, How Selections Work and Nested Selections.
Peter Cook June 2013