WebServer insert eeprom read into a html table?

Hi sorry for a newbee question but can’t seem to figure out how to insert an eeprom read into a html table? I just need to replace both 23% below to display epprom reading from": EEPROM.read(25);

<table border=1>\
<th scope=\"col\">Item</th>\
<th scope=\"col\">Percent</th>\
<tr style=\"height:23%\">\
<th scope=\"row\">Medium</th>\
<td><span>23%</span></td>\
</tr>\
</tbody>\
</table>\

How are you inserting the html table into your program ?

void handleRoot() {

\ \ \ \ \ \ \ \
Item Percent
Medium 23%
\ }

What platform are you developing for?
I’m not aware of any that allow you to just ram HTML into a sketch like that.

I had exactly the same problem as myele! :frowning: :frowning: :frowning:

Using esp8266 on Arduino IDE

void handleRoot() {
<table border=1>\
<th scope=\"col\">Item</th>\
<th scope=\"col\">Percent</th>\
<tr style=\"height:23%\">\
<th scope=\"row\">Medium</th>\
<td><span>23%</span></td>\
</tr>\
</tbody>\
</table>\
}

this not a valid C++ function at all, and the ESP-core does not support this. You need to first transfer the html into either a char * or a String (could be in progmem though)
what i do is i put it in to a String and add all dynamic parts into that on the fly,

I’m a total total newbee just learning code. I’ve been basically learning OFF other peoples examples/code. But a lot of times other peoples examples/written code is bad. I’m looking for the simples way to add html with live variables from EEPROM

I ended up doing this and it works fine:

void handleRoot() {
 String content = "<center>
<table>";
 content += "<tr><td>Stuff</td><td>" ; content += EEPROM.read(25); content += "</td>";
 content += "MORE HTML HERE....";
 content += "MORE HTML HERE....";
}

That's pretty much the way i do it.

Oh ok cool, was wondering if there was a better way but its nice to know there isn’t so that I don’t have to keep looking.

String contenti tend to go for a single letter variable name, since it is used so often.