Having trouble with import/export

I’m attempting to build a home program with multiple pages. One of the pages takes user input to build a table. I want to see that table on another page. I’m thinking the easiest way is to export it. My problem is I’m not fully versed in exporting a html element. I’ve found plenty to read on exporting js functions and the like. Can you export am html table the same way? Or am I doing something wrong?

Generally “importing” and “exporting” HTML isn’t available in the same capacity as it is in JavaScript. HTML and JavaScript are both web technologies, but aren’t the same in terms of capabilities.

The idea of re-using HTML in different parts of a website is very much a reasonable idea, and as such most web frameworks provide ways to help you reduce duplicated code. There are some things like iframes, which render entire pages within the current page, but these aren’t very flexible. Beyond such technologies, a browser only “loads” up parts of HTML as full pages. Anything else is usually handled by JavaScript on the client-side, or the HTML itself that is loaded is handled server-side.

Usually you use a programming language (like JavaScript) to handle the logic to “duplicate” this HTML between pages. This is essentially how web frameworks like React/Angular/Vue work, and many server-side languages and frameworks render their pages to end users.

Regardless of where or how its done by a programming language, the result is the same. The HTML shown to the user is dynamic to what you want to do, how you want to do it.


So if you want to re-use/build multiple pages using similar elements for your website, you should look into using a web framework of some kind. Which one is best for you depends more on what you want to do, and what kind of experience level you have.

I’m at the beginning of learning python. Is that one of the framework languages?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.