PieterP:
There is absolutely no need to use an SD card. Just use the SPIFFS, it’s much faster and easier than an SD card, and the ESP8266 has plenty.
The easiest way is to use client-side JavaScript to fill the table. The ESP only serves static files: HTML with an empty table, CSS with the style of the table, and JS that downloads the static CSV data file, and builds the dynamic HTML table.
The computer that renders the web page is much more powerful than the ESP, and JS was designed for manipulating HTML.
Here’s a similar example:
A Beginner's Guide to the ESP8266
You just have to change the JS program to display the data in a table instead of a graph.
Pieter
The idea to fillout the html-table from JavaScript is working well, thank you.
Just for records, here are sample of JavaScript I have to use to fillout the table:
<script>
let headerItems = ["Header1", "Header2", "Header3"];
let dataItems = [
[ "Data1", 1111, "ABC1" ],
[ "Data2", 2222, "ABC2" ],
[ "Data3", 3333, "ABC3" ],
[ "Data4", 4444, "ABC4" ],
[ "Data5", 5555, "ABC5" ]
];
function generateTableHead(table, data)
{
let thead = table.createTHead();
let row = thead.insertRow();
for (let element of data)
{
let th = document.createElement("th");
let text = document.createTextNode(element);
th.appendChild(text);
row.appendChild(th);
}
}
function generateTableData(table, data)
{
for (let rowelement of data)
{
let row = table.insertRow();
for (let element in rowelement)
{
let cell = row.insertCell();
let text = document.createTextNode(rowelement[element]);
cell.appendChild(text);
}
}
}
let table = document.querySelector("table");
//order of those two functions may be reversed or even call multiple times
generateTableData(table, dataItems);
generateTableHead(table, headerItems);
</script>
html code must to have this element:
<table border='1'>
<!-- here goes our data! -->
</table>