Hi Charles,
thanks for your post, and sorry for the trouble.
Yes, the HTML import into TablePress is quite strict (as the internal PHP functions that are used for this are quite strict), and the HTML files that are generated by those spreadsheet programs can unfortunately be very complicated.
To find out more, could you clarify or give example of what errors you get? Also, can I see that Excel file somewhere? (If you want, you can email it to me, my address is in the main plugin file “tablepress.php”).
Regards,
Tobias
Hi,
for everybody following this thread: I had a look at some files that Charles sent me.
Unfortunately, all that I can suggest for now is to keep the Excel file as simple as possible, and to not use sophisticated features in Excel, like scrolling rows. Everything that’s unrelated to the data should not be used, to make the Excel file and with that the exported HTML file as simple as possible.
This should give an easy to import HTML file, in most cases. If errors remain then, it is sometimes possible to manually fix/remove them, by editing the HTML in a text editor.
Regards,
Tobias
Tobias,
After several exhausting days, I think I’ve pinned down an isolated bug in the HTML import. I’m sure there are other reasons it will kick up an error, but in this case, it’s related to length: if I keep the import under a certain size (not clear if it’s file size, number of characters, or if characters in-cell vs markup makes a difference — I’ve been adding in-cell content to test) it imports fine, if it’s any bigger it fails with a “Data for the import is invalid” message.
Here’s a painstakingly derived test case: http://degreesofclarity.com/emsbasics/goodshort.html
This imports without a problem. However, if you add a single additional character to any cell (spaces count), it fails.
Thoughts?
Hi,
thanks for this investigation, but the error that you are experiencing is different to that of the original poster.
The original poster gets errors about the internal structure/HTML format. In your case, the error is raised before the actual import is done. Therefore, my assumption is that this is indeed related to the size of the file. And I think that the import fails because there’s some sort of size limit on your server, e.g. for the uploading or for the temporary storage after the download. Could that be possible?
That’s my conclusion because the file works fine on my test server, and I can add extra content to the cells or even new rows without problems.
Regards,
Tobias
Jeepers. You’re right, it’s working for me now as well. Suffice to say that it’s an inconsistent issue.
Incidentally, for anybody who’s also working with generated HTML, the Textism Wordcleaner does a quite good job of getting your code into a workable state (http://textism.com/wordcleaner/).
As a long term solution, what’s the chance of a more robust HTML import somewhere in the future? There are clearly a number of us having issues.
Hi,
good to hear that you were successful in importing the HTML file!
And thanks for that link, that should indeed be valuable to other users as well!
About the more robust HTML import: TablePress is using functions that are available in PHP, for HTML and XML parsing. Unless those get more robust, I don’t foresee a change in the current behavior. Other solutions would mean to write a custom HTML parsing, but that’s not something that I’m capable of doing.
Instead, I’m planning to add import from Excel files (.xsls), which can mabye help in working around HTML import problems.
Regards,
Tobias
Thank you — I think that would help. And thanks in general; despite the non-step demands, I know we’re all deeply thankful for your generous work with this project.
Hi,
no problem! 🙂 Thanks for the nice words, I really appreciate it!
Best wishes,
Tobias
P.S.: In case you haven’t please rate TablePress here in the plugin directory. Thanks!