This is the code for Chapter 8, Figure 2 from D3.js in Action showing how to make a spreadsheet using D3 data-binding to create table, th, tr and td elements.