• Hey guys,

    I’ve just discovered WP Table Reloaded and I love it! I’m in the process of updating my website so that all of its tables are in WP Table Reloaded format, but I seem to have run into some trouble with importing one particular table.

    If you go to this page you can see an example of a table that I’d imported from HTML. It worked without any problems.

    Now if you go to this page you’ll see an example of how the website looked before I discovered Table Reloaded (it looks rubbish!). This is the page I am having trouble updating. When I import my table from HTML, I get the following error message:

    Warning: Invalid argument supplied for foreach() in /home/aus49541/public_html/wp-content/plugins/wp-table-reloaded/controllers/controller-admin.php on line 917

    Warning: Invalid argument supplied for foreach() in /home/aus49541/public_html/wp-content/plugins/wp-table-reloaded/controllers/controller-admin.php on line 919

    Table could not be imported.

    I have uploaded the actual HTML table I’m trying to import here. If I convert it to CSV and then import it, it works fine, but I lose all my formatting that way, which is why I’d rather keep is as HTML.

    Does anyone have any idea why it might not be importing properly?

    Thanks heaps,

    Dan

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your question.

    I had a quick look at the table that causes trouble, but could not spot the reason for problems. I guess it is some inconsistency in the code for the library that does the import.
    Therefore, I suggest that you import the table from CSV. You will indead lose your styling, but this might actually be a good thing: You can then start to use CSS instead of HTML code for the styling.
    As it seems, your styling consists of the first column being bold print and the last column being italics.
    To achieve that in CSS, all you need is the following code, and no more messing around with HTML code in each table cell:

    .wp-table-reloaded-123 .column-1 {
      font-weight: bold!important;
    }
    .wp-table-reloaded-123 .column-4 {
      font-style: italic!important;
    }

    (where 123 is the ID of your table after the import).
    This code would need to be pasted into the “Custom CSS” textarea on the “Plugin Options” screen and that’s it.
    Doesn’t that sound much better than all that HTML code in the table cells? 🙂

    Best wishes,
    Tobias

    Thread Starter schaumann

    (@schaumann)

    Thanks for getting back to me Tobias, much appreciated! That’s a good idea, I’ll CSS it up instead, I agree it will be much easier in the long run.

    Cheers for a great plugin too 🙂

    Dan

    Thread Starter schaumann

    (@schaumann)

    Hey Tobias,

    Sorry to bother you again about this, but I’ve run into more problems with the error message today 🙁

    I was able to upload the first draft of an updated table for this page and then spent a number of hours correcting some HTML formatting, as well as trawling the web for Youtube links to the songs, to create a final draft of the table, so to speak. I’ve uploaded a copy of this final draft here. I tried to import the table after I’d finished adding the links, but was greeted with the error once more. Of course if I export to CSV I’ll lose the links & formatting and will have to copy them all in manually.

    The problem I’ve found in using CSS is that I don’t want all words in the first column to be bold, nor do I want all words in the final column to be in italics. And rather than edit the tables within the plugin itself, I just find it much easier to edit them in Dreamweaver and then import them.

    Do you know if there is a fix to this error when importing my HTML tables, or do you think my only option is to import CSV and copy formatting/links into each individual cell? If you can suggest anything to get the HTML import working I’ll be more than happy to make a donation!

    Thanks,

    Dan

    Thread Starter schaumann

    (@schaumann)

    Just some further info – through the process of elimination, I’ve found that I can import the table if I remove all of the Youtube links *after* this entry:

    CUNNAMULLA – I’ve Been Everywhere – Lucky Starr

    If I try importing the table with any more Youtube links down the page, I get the error. The next link down is DAINTREE – Papa Whiskey November – John Williamson – there doesn’t appear to be anything wrong with the link but it just won’t let me import the table if it (or anything else below) is there.

    I’ll be ok to import what I can and continue editing the cells manually – just thought I’d let you know about this eccentricity 🙂

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for the details on your investigation.

    Unfortunately, I don’t have any ideas on why the HTML import is not working for the entire table but only for the part up to that one link. I can only imagine that it is a problem in the underlying import library, that I use for import of HTML files. I don’t really know how to debug that though 🙁 Sorry.

    The problem with the styling makes sense as well… If you don’t want to style all words in a column the same, CSS is not really the best solution (or at least just CSS is not the final solution).

    And if you edit your table in Dreamweaver nevertheless, why don’t you simply use that generated HTML? You could for example create a “Page Template” for your page and then copy&paste your HTML code for the table from Dreamweaver to that file, i.e. use the original HTML code.

    Regards,
    Tobias

    Thread Starter schaumann

    (@schaumann)

    Thanks again for your suggestions Tobias, much appreciated. It’s cool about the importing thing, I can live without it 🙂

    Before I found this plugin I used to copy and paste the HTML from Dreamweaver directly into my WordPress post, but I hated the way it looked. Whereas, I love the design of Table Reloaded and the fact that you can filter the entries etc, so I’d like to do whatever it takes to keep using it…

    One more little problem I’ve found, if you don’t mind me running it past you. For the past few days I’ve been trawling Youtube for links to as many songs as possible, and adding these links manually to the cells via the plugin. This afternoon I’ve been doing it to this table. Now if you scroll down to the Sydney (Redfern) area, you’ll see there are songs listed called “House Of The Rising Flood,” “Ivy Street” and “Warakurna.” All of these songs have data saved successfully in the “youtube” column, which shows up as normal in the edit screen, but nothing displays when you view the page. There are about five or six other cells as you scroll down that also have this data which is not showing up.

    Do you have any idea at all why this might be? Or do you think there’s just something about these tables I’m trying to use that simply isn’t compatible with the plugin? If this is the case I guess I’ll have to go back to using plain old HTML, which is cool, but it will be a shame… as I said I really do love the way Table Reloaded looks & functions!

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your feedback!
    It is nice to hear that you like to use the plugin. 🙂

    By the way: You actually use the features of the DataTables JavaScript library on other tables as well (it just requires manual loading of the script), see http://www.datatables.net.

    For your problem on the links which are not showing up:
    The HTML for them is invalid. For example, this one:

    <a href="http://www.youtube.com/watch?v=YQH19o5w44M" target="_blank" title="Kevin Bloody Wilson - House Of The Rising Flood"</a>

    The beginning <a> is not closed after the “title” attribute and then there is no text for the link. If you change that HTML to

    <a href="http://www.youtube.com/watch?v=YQH19o5w44M" target="_blank" title="Kevin Bloody Wilson - House Of The Rising Flood">Youtube</a>

    it should show up the same way as your other ones. I assume that this or similar also happened with the other links that are not working.

    Best wishes,
    Tobias

    Thread Starter schaumann

    (@schaumann)

    Hahaha, oh my, I should have picked up on that, sorry to waste your time! I think I was just staring at the computer for too long. I’m glad to hear it was me and not the plugin.

    Thanks for the link to DataTables, it looks interesting. I’m quite new to this WordPress table business so I’ll be sure to have a browse through and see what it can do for me.

    Love your work Tobias, and thanks again for all your help. I’ve sent a well-earned donation your way 🙂

    Cheers,

    Dan

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi Dan,

    good to hear that you were able to solve this with my hint! And thank you very much for the donation, I really appreciate it!

    Best wishes,
    Tobias

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘[Plugin: WP-Table Reloaded] "Table could not be imported" error’ is closed to new replies.