Hi,
thanks for your post, and sorry for the trouble.
I haven’t directly tested this myself, but I can see that this could indeed cause problems for the import, because the detection of HTML tables (specifically the HTML <table> tag) gets precedence over the CSV import (which is kind of like a last resort here, because pretty much everything can be interpreted as a CSV file, with a bit of good will…).
As for a quick workaround, you could maybe try opening the CSV file in Excel and then save that as an .xlsx file and import that into TablePress. As an alternative, you could (at least temporarily) return to using the “old” import engine of TablePress, where CSV is tried to be imported before the HTML format. That is possible by adding the line
add_filter( 'tablepress_use_legacy_table_import_class', '__return_true' );
to the end of your theme’s “functions.php” file.
Now, a remark: HTML tables inside the cells of an HTML table? Do you really need such nesting? What are you trying to achieve with that?
Regards,
Tobias
Thanks! I tried the Excel workaround, but I got an error each time I tried to import it. I’m not too excited about the idea of using an old import engine, so instead we’re looking into changing the tables to DIVs to get around this issue.
I know its weird, but we manage data about credit cards in a Google Docs sheet and we put all that info into tablepress in a way that displays lots of information nicely within each cell. You can see one use of this here: https://frequentmiler.com/best-credit-card-sign-up-offers/
Hi,
thanks for the example! I can see what you are doing now. Indeed, the best solution for the long term would be to directly use more appropriate HTML structures here. HTML Tables should be used for tabular data, and not for layout purposes like this.
(In the mean time, don’t be afraid to use that “old” import engine: It will be part of TablePress for the foreseeable future, it just won’t get new features/enhancements, like support for other data formats, etc.)
Best wishes,
Tobias
We have it all working now, but the table first displays without CSS formatting and then formats after a few seconds. You can look at the link I posted previously to see that happen. Can you think of any way around that? Can we somehow force the styling to apply while the table loads or keep the table from displaying until the styling is complete?
Hi,
I can’t seem to reproduce this. For me, the styling appears immediately (unless I’m looking at the wrong page or table)?
Also, I can’t really see what would be causing such behavior, as all CSS files are included properly, from what I can see.
Regards,
Tobias
I’m sorry about wasting your time! Over the weekend, we fixed this by moving the css to load earlier. I didn’t have a chance to come here to update this until now.
Hi,
ah, no problem! Good to hear that everything is working!
Best wishes,
Tobias
P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!