+function make_table_offense(players) {
+ let rows = [];
+ {
+ let header = document.createElement('tr');
+ add_cell(header, 'th', 'Player');
+ add_cell(header, 'th', 'Goals');
+ add_cell(header, 'th', 'Assists');
+ add_cell(header, 'th', 'Hockey assists');
+ add_cell(header, 'th', 'Throws');
+ add_cell(header, 'th', 'Throwaways');
+ add_cell(header, 'th', '%OK');
+ add_cell(header, 'th', 'Catches');
+ add_cell(header, 'th', 'Drops');
+ add_cell(header, 'th', '%OK');
+ add_cell(header, 'th', 'Soft +/-');
+ rows.push(header);
+ }
+
+ for (const [q,p] of Object.entries(players)) {
+ let throw_ok = 100 * (1 - p.throwaways / p.num_throws);
+ let catch_ok = 100 * (p.catches / (p.catches + p.drops));
+
+ let row = document.createElement('tr');
+ add_cell(row, 'td', p.name); // TODO: number?
+ add_cell(row, 'td', p.goals);
+ add_cell(row, 'td', p.assists);
+ add_cell(row, 'td', p.hockey_assists);
+ add_cell(row, 'td', p.num_throws);
+ add_cell(row, 'td', p.throwaways);
+ add_cell(row, 'td', throw_ok.toFixed(0) + '%');
+ add_cell(row, 'td', p.catches);
+ add_cell(row, 'td', p.drops);
+ add_cell(row, 'td', catch_ok.toFixed(0) + '%');
+ add_cell(row, 'td', '+' + p.offensive_soft_plus);
+ add_cell(row, 'td', '-' + p.offensive_soft_minus);
+ rows.push(row);
+ }
+ return rows;
+}
+