Public
Edited
Jan 22, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viewof table = Inputs.table(conversationFromExcel)
Insert cell
Insert cell
Insert cell
conversationFromExcel
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
Insert cell
function createConversationTableV2(conversation) {
// Get the names of the participants
var statements = conversation[0];
// Create the table element
var mytable = document.createElement("table");
mytable.style.width = "320px"
mytable.style.class="wp-block-table"
mytable.style.tableLayout="fixed"
// mytable.style.border = '1px solid black';

for (var i = 0; i < conversation.length; i++)
{
var statement1 = conversation[i].B;
var statement2 = conversation[i].C;
var row = document.createElement("tr");
var cell = document.createElement("td");
// cell.style.width="100px";
var iDiv = document.createElement("div");
iDiv.id = "cell" + i + 0;
iDiv.innerHTML = statement1;
cell.appendChild(iDiv)
row.appendChild(cell);

var cell = document.createElement("td");
var iDiv = document.createElement("div");
iDiv.id = "cell" + i + 1;
iDiv.innerHTML = statement2;
cell.appendChild(iDiv)
row.appendChild(cell);

mytable.appendChild(row);
}
return mytable;
}

Insert cell
conversationFromExcel = firstconvo.sheet(0, {
headers: false
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

message="You are a world-renowned, beloved author";

Insert cell

mermaid`sequenceDiagram
"Actor A" ->> "Actor B": ${message}
"Actor B" -->> "Actor A": response
`

Insert cell
firstconvo = FileAttachment("FirstConvo.xlsx").xlsx()
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