Solved How to save QList to a HTML table?
-
There are many different QList in my projects, for the convenience of viewing the data, I have write some QList to Html files.
But the method of writing is too complicated, I searched other methods, and found that QWebEngine can read html file easily.
Then, how to write an HTML file please?
For example:typedef struct { QString name; int score[10]; } StudentNode; QList<StudentNode> studentList;
How to write "studentList" to a html table?
Best Regards! -
@tovax said in How to save QList to a HTML table?:
Then, how to write an HTML file please?
Well, you should learn HTML basics first: https://www.w3schools.com/html/html_basic.asp
Here you can see how tables are created in HTML:https://www.w3schools.com/html/html_tables.aspFor your specific use case: iterate over studentList in a loop and create a row in the HTML table for each entry.
-
@tovax said in How to save QList to a HTML table?:
Then, how to write an HTML file please?
Well, you should learn HTML basics first: https://www.w3schools.com/html/html_basic.asp
Here you can see how tables are created in HTML:https://www.w3schools.com/html/html_tables.aspFor your specific use case: iterate over studentList in a loop and create a row in the HTML table for each entry.
-
@jsulm
Hi, jsulm, Thank you very much.
Best Regards! -
@jsulm
Just to say: I totally understand why you referencedw3schools
for examples, especially since the darn thing comes out top in Goggle searches. But, like others on the web, I find their stuff often incomplete/unexplained etc. Personally I prefer to search/start from, say, https://developer.mozilla.org/en-US/docs/Web/HTML (mozilla/MDN) for things HTML/CSS/JS etc. But maybe that is less beginner-friendly. Just a heads-up for @tovax. -
@JonB
Hi, thanks a lot for your reply! I will read it.
Best regards!