Public
Edited
Sep 13, 2023
Insert cell
Insert cell
Insert cell
Insert cell
my_table = {
const keys = Object.keys(results[0]);

return html`<table>
<thead>
<tr>
${keys.map((key) => html`<th>${key}</th>`)}
</tr>
</thead>
<tbody>
${results.map(
(row) => html`
<tr>
${keys.map((key) => html`<td>${row[key]}</td>`)}
</tr>`
)}
</tbody>
</table>`;
}
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more