• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Display a table with undefined non-null value | ESP32 SPIFFS

Q&A Forum › Category: ESP32 › Display a table with undefined non-null value | ESP32 SPIFFS
0 Vote Up Vote Down
Théo asked 5 years ago

Hi,
I’m new on forum, sorry if my question was already asked but I’m stuck in my project.
I store data in an array (defined length in .ino: myTable[100];) this data is received by ESP NOW and when a new data is added to array I want to display it in my table on my web server. So, how to ask to js to grab data only when new data is coming without doing setInterval checking array a unlessly.
And my hardest difficulty is: how to display new value in a table? Actually, I know display table write in raw in my .html but how increase dynamically the table using .js?
I apologize if I wasn’t clear, and thank you if you take your time to help me.

Question Tags: ESP32 WebServer Table Array
3 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

Hi Théo.

To add new rows to the table using JavaScript and set its value, take a look at this: https://www.w3schools.com/jsref/met_table_insertrow.asp
I think this is exactly what you are looking for.

To get new data without setInterval, you can use websockets or server-sent events.

We don’t have a specific tutorial for server-sent events.
However, we use them in this project: https://randomnerdtutorials.com/esp32-bme680-web-server-arduino/
See if you can apply this concept to your own project. When new readings are available, send those readings to the browser as events.

At the moment, we don’t have any tutorial about websockets. We plan to do it in a near future. Meanwhile, you can take a look at this tutorial created by one of our readers: https://m1cr0lab-esp32.github.io/remote-control-with-websocket/

I hope this helps.

Regards,
Sara

0 Vote Up Vote Down
Théo answered 5 years ago

Hi Sara,
Your help and RNT website is so helpful. Just thanks for all!
 
Regards,
Théo

0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

Great!
I’m glad I can help.
I’ll mark this issue as resolved. If you need further help, you just need to open a new question in our forum.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.