I am following the contentEditable demo here: https://codepen.io/Shokeen/pen/eJRRVw. My code is the exact same for the CSS and JS, but I made some slight changes to the HTML below:
<div id="wrapper">
<section>
<h1 class="headline">contentEditable Demonstration</h1>
<button id="editBtn" type="button">Edit Document</button>
<div id="editDocument">
<h1 id="title">A Nice Heading.</h1>
<p>Last Edited by <span id="author">Monty Shokeen</span></p>
<div id="content">{{temp_df | safe}}</div>
</div>
Basically, I replaced the paragraph id="content" line with a div id="content" line where the temp_df is a Pandas data frame.to_html imported from Python using the Flask framework. Ideally what would show up is a table that is editable just like every other editable item in the code pen above. However, when I run this, the table does not show up at all. After some testing, the interesting thing I found is that if I run the program, open it up in the browser (which does not show the table), then close the browser, then reopen the browser, the table shows up. I have tried this in multiple browsers so it is likely not a problem unique to anyone browser. I have also included the messages in my terminal throughout this whole process.
1 - When I run the Flask program
2 - When I click a button on my website to show table (table does not show)
3 - When I close the browser and reopen the program in a new browser (table now shows)
