Please read the Frequently Asked Questions and the documentation before asking for support. Thank you!
For help or support questions, use the WordPress Support Forums. Please open a new topic there (with the tag “wp-table-reloaded”). You should include as many information as possible, like version information, a URL to your site, etc. This makes it much easier for me to help you. You may write in English or German. Before posting though, please search through the existing topics. Maybe your question has been answered before? Thank you!
If my answer helps you to solve your problem, it is recommend to do a small donation, as I invest a lot of free time in answering support questions.
If you find a bug or have a feature request, please tell me about it by email with an explanation, as detailed as possible.
It would help a lot if you could add an issue ticket in the issue tracker on Google Code.
Below you can find all comments made thus far. Please keep in mind that most of the issues described here are solved in current releases. Also some pieces of advice I gave might not be valid anymore for the current release. It is no longer possible to add a comment. Use the Support Forums for your questions.


Hi Tobias,
Great plugin you created…
I’m wondering if there is a way to automatically align numeric content to the right, overriding the default CSS styling.
Regards,
Jackey
Hi Jackey,
thanks for your question.
I don’t really know if there are CSS selectors that will only detect numeric content. But if your numbers are all in the same column, you could align all content in that column to the right, with some CSS code like
(The “1″ and the “3″ need to be changed accordingly.)
This would just have to be pasted into the “Custom CSS” textarea in the “Plugin Options”.
Hope this helps.
Best wishes,
Tobias
Tobias, first of all – incredible plugin. Powerful, well executed and documented.
On aligning text right, the problem with just using the column class is that it also affects the headings. So the titles in the headings run into the arrows used for sorting. The solution would be to only
text-align: right;the body rows. Is there a way to do that?Hi Bill,
thanks for your comment!
Yes, that’s possible :-) You just need to add a
tbodyinto the selector.This code should do what you want:
Best wishes,
Tobias
Hi Tobias,
Thank you for the perfect plugin.
It works perfect. Only one small problem, which I can not solve by myself.
I use TableTools to export and print the tables’ content. Only the print is not working proporly in IE. It works fine in Firefox. Somehow in IE, not all header information is cleared and nothing is printed.
I work with the theme Atahualpa. Example is http://www.hoogebergschejeugd.nl/?page_id=694. Can you help me with this one?
Regards,
Ton
Hi Ton,
thanks for your question. Unfortunately I won’t be able to help with the TableTools library. It is an external library, not written by me, that I just include.
You could have a look at the documentation on the DataTables website, where there should also be a page on the TableTools somewhere. Does it work there?
Also, WP-Table Reloaded does currently not ship with the latest version of TableTools, but the next version will have an update. It is possible that your problem is fixed then.
Until then, you’ll just have to live with the problem, I guess. I would not be too worried, as there are probably only few IE users who then want to print your table using TableTools.
Kind regards,
Tobias
Tobias,
Thanks for your quick answer.
It does work at the DataTables website, but there it is not divided into subareas.
This options is useful for us, to print by our club members if data is changed or new young people entered our golf club.
Will ask to use Firefox (love this browser).
Look forward to your next version.
Kind regards,
Ton
Hi Ton,
ok, that could mean that the new version will fix it then (might be two more weeks though, as I’m busy right now).
And using Firefox is definitely a very good alternative :-)
Best wishes,
Tobias
I’m probably just suffering an id1ot error here, but I can’t figure out how to make the “Custom CSS” affect all tables, not just the IDed ones. To be exact, The header color, it is currently only changing on one table, and I want it to affect all tables across the board the same way, no IDs. Does that make sense?
Hi Ted,
you are probably using a selector like
.wp-table-reloaded-id-1in your CSS. That will obviously only affect table ID 1. To apply the CSS to all tables, just remove the “-id-1″ from the selector. I.e., this code will change the header color for all tables:Best wishes,
Tobias
Yep, I was right. I was suffering an id1iot error. LOL. Thank you very much, fixed the problem right away.
Hi, me again :)
Is there a way to filter a table and present only a subset of the records? Something like when you type something into the search field?
Like this:
[table id=5 / filter:fieldname="search criteria"]Thanks in advance!
Hi,
just to let everybody know: I’m working on a custom solution for Paulo (and two other nice people from the WP Support Forums).
Results will probably be published soon here.
Regards,
Tobias
I am having trouble getting my table to render when clicking into links within my WP site.
Any help would be much appropriated.
Thanks!
Hi Brendan,
thanks for your comment.
Unfortunately, I don’t really understand what you are having trouble with. I just took a look at your website and everything appears to be fine.
Could you please describe a little bit more detailed, what the problem is?
Thanks!
Tobias
Tobias,
I am wondering if you have a solution for this: http://wordpress.org/support/topic/365554
The question is to show a search query filled by default when a table is loaded on a page, within the Shortcode. Please let me know, or let me know how I can have this added, thank you.
Hi Peter,
thanks for your question. Indeed, I have found a (custom programmed) solution for the problem in that forums thread.
However, from your comment, it sounds as if you are looking for something slightly different.
The solution from above will filter unwanted rows before the data is sent to the browser, i.e. the user will never actually see it. Also the dynamic “Search” function is not affected by this.
From what I understand from your comment, you want to fill the “Search” textfield with an initial value, so that the table will initially search for that. But if the search word is removed, you want the complete table to show. Is that correct? (If not, please describe your needs again :-) )
Thanks!
Tobias
Hello Tobias!
This is simply one of the best and most complete plugins, I’ve ever seen! I do have a question, which may even serve as a request for your plugin:
Is it possible to add a form with a filtering list, so the users select which table they want to see?
I’m developing a website for a school, and there will be a page for class schedules. I’d like users to select their class, and then the subject, and then press the submit button, which will take them to the table with the selected course’s schedule. Here’s a little basic and pretty ugly example I set up: http://www.uesma.edu.ec/example.html
Then I’d like to add this list to my sidebar or to some page.
Is it possible? Is it easy to implement? Thanks a lot and keep up the good work!
Hi,
thanks for your question and the comment!
Your desired behavior is not natively possible with my plugin. The reason is that it actually is unrelated to the plugin. However, it is not hard to implement it. With your form, you actually have a pretty good starting point. Now all you need to do is use it in a PHP script (i.e. as a customly coded WordPress plugin). That plugin basically only needs to transform the selection from the user into the corresponding table ID (you’ll only need a list for that). Then your script will only need to call the provided WP-Table Reloaded template tag function
wp_table_reloaded_print_table( "id={$id}" ). And that’s basically it :-)Best wishes,
Tobias
Hi Tobias,
Again a question from me.
I know that TableTools is just an add-in for you, but still it has great potential. In WP-Table Reloaded, some features are selectable. I really need a range filtering functionality on a specific column. Seeing examples in TableTools at API for this. Can you tell me, if it is easy to incorporate this function into WP-Table Reloaded? I saw that Custom Commands are possible over there.
Any help possible from you?
Kind regards,
Ton
Hi Ton,
usually it is possible to add such custom code to WP-Table Reloaded by using the filter hooks in an Extension.
If you can tell me the exact URL of the example you mentioned, I can tell you where to add the code.
Best wishes,
Tobias
Hi Tobias,
Thanks for your quick reply.
This is the url: http://www.hoogebergschejeugd.nl/?page_id=713 as an example.
In this table, I want to filter on “groep”.
Kind regards,
Ton
Hi,
can you clearify what you mean by “filter on ‘groep’”? Do you mean: If someone enters something into “Zoek:” only the “groep” table shall be searched?
And where did you see examples for this in the TableTools API?
Regards,
Tobias
Hi Tobias,
I mean that I want e.g. filter on “groep” = 1 and see only the rows of that group.
In this case I can make one big table instead of 10 subtables as I now have on different pages.
I did see this http://www.datatables.net/examples/plug-ins/range_filtering.html
Regards,
Ton
Hi Ton,
ok, now I understand everything :-)
This actually looks like you want the filtering to be done before the table is shown on the page.
That’s what I’ll release an Extension for in the next days.
Best wishes,
Tobias
Hi Tobias,
Again many, many thanks.
I added your filter extension to the real site and it is working perfectly. Also works with the extra added text editor.
All the best,
Ton
Hello Tobias, thanks for your plugin. Great work!
It worked fine until I installed the latest version of WP (WordPress 2.9.2). Now it works fine, but the button in the toolbar is not there anymore and the tablesorters don’t work either.
Anyway, is just a little trouble. Best regards!
Hi Diego,
thanks for your comment. However, I was not able to reproduce these problems. Both of the two features work fine on all my WP 2.9.2 installation and so far you are the only one who has reported this problem.
Is there maybe another plugin breaking the features? Could you check by disabling your plugins?
Thanks!
Best wishes,
Tobias
Exactly. I found the plugin that was breaking the features of http://www.wp-eventscalendar.com/
It’s a very useful plugin, that I need too, so, maybe I just need to put your tables with [ ] and no more toolbar option.
Thank you for your concern.
Hi Diego,
thanks for your comment. However I still can not reproduce the problem. All my sites with WP 2.9.2 are working fine (including this one as you can see).
I also do not see any changes in the code of WP that could make the plugin break when updating from 2.9.1 to 2.9.2.
Can you test again with all other plugins disabled?
Also, please provide the URL of the site with the table that is not working.
Best wishes,
Tobias
Dear Tobias,
As I told you, the problem was with that other plugin and yours (Events calendar).
When you wrote: “I still can not reproduce the problem”, did you mean that you installed “Events calendar” on your blog? I tested with all the plugins disabled and it works fine. Just with Events Calendar, it crashes. It’s a pitty.
Sorry my english. And I forgot to say thank you and best regards. You are very nice person responding the people questions, many newbies as me.
Thanks
Hi Diego,
no, I did not install Events calendar on my site (I just don’t have the time). I did however take a short peak into the code and can see various places that might eventually lead to problems.
One such place is in the way the plugin embeds it’s JavaScript into the page. Therefore, I strongly believe that the error you are experiencing is caused by Events calender. However, I can not fix the bugs in that plugin. Instead, I ask you to contact its developer who knows his code better and might be able to fix the problem.
Best wishes,
Tobias
Tobias,
Great plugin, which I will certainly use.
I have another question. How did you get the toggle effect of the paragraphs on the plugins page? Is there a WP plugin for this?
Han
Hi Han,
thanks for the question.
That’s not a plugin, but I wrote a blog post about that feature a while ago: http://tobias.baethge.com/2009/07/expandhide-accordion-feature-explained/
You should find an explanation there.
Best wishes,
Tobias
Great plugin! I want to create a table which lists information along with an image. Easy enough to do individually, but what if I have a thousand “records”?
Is it possible to load images into the table via CSV, without going to the media library and loading them individually?
I can duplicate and import the same code from my CSV file, which WordPress generates to place the image into the table when it is done individually, but just adding the matching code doesn’t seem to work.
I assume there is some background function which links the image to the table which allows it to work.
I can even get image placeholders to appear via HTML in the CSV but there seems to be a path issue.
I am new to WordPress, so forgive me if this is a dumb question.
Thanks!
Hi Cecil,
thanks for your question.
It is definitely possible to load images into the table via CSV, if you load them as their corresponding HTML code. There is no “background function” as you call it that links tables and images. In fact, the plugin doesn’t even know that you have an image in the table. The plugin only sees text that happens to be HTML for showing an image.
You say that you can duplicate and import the code find and also see the image placeholders in the page. That really sounds as if you the URLs to the images are wrong (or at least don’t match to the actual image URLs, because they are relative URLs and not absolute URLs).
And don’t worry, there are no dumb questions :-)
To further assist, it would be good, if you could provide the URL to the table that is not working and if you could describe what you did to insert the images (i.e. how does the code and the CSV file look like).
Best wishes,
Tobias
Tobias,
I love your plugin. I was wondering, if there is a way to change the font to “Helvetica” (for someone who does not know PPP or HTML. Thanks in advance.
Hi Alexa,
thanks for your question. Changing the font to a different one is easily possible with CSS. Please have a look at the question “How can I change the font, font size and font color of a table?” in the FAQ, where you will find the solution.
Best wishes,
Tobias
Hi Tobias,
Thanks for the great plugin. One question though: Could be quite a lame one, but how can I change the font-type or make strong just one row (a #colspan# one), e.g.: column 1, row 5?
Thanks Again
Hi Bobby,
that could be achieved with Custom CSS like this:
Just change the table ID and the row number accordingly, then paste the code into the “Custom CSS” textarea on the “Plugin Options” screen. As you have a colspanned row, there’s no need for the column number, as it doesn’t really matter.
You might also wanto totake a look at some of the questions in the FAQ, which could show you how the styling works.
Best wishes,
Tobias
Told you, I am a noob :p. Thanks again!
Hello Tobias,
Thanks for the good work you are doing, man you are great.
Well, I want to know, if there is a way to disable the search box and the small arrows from appearing… And I also want the table to show in full…
Thanks and hope to hear from you soon.
Hi,
thanks for your comment.
All of this is easily possible. The easy solution for you would be to uncheck the “Use JavaScript library” checkbox in the “Table Styling Options” on the “Edit” screen of your table. If you want a more fine grained control, you can check/uncheck checkboxes for various features in the “DataTables JavaScript Features” section (right below the first mentioned one, and initially hidden, so just click “Expand”).
Hope this helps.
Best wishes,
Tobias
Wow, man it worked. And thanks for the early reply! What about bolding and adding color to the text in first rows…?
Hi,
good to hear that!
There are a few examples regarding styling (bold font, color, …) on the FAQ page. That should get you started. All relevant code has then be entered into the “Custom CSS” textarea on the “Plugin Options” screen.
Best wishes,
Tobias
Hey Tobias,
Awesome plugin. I was spending quite a bit of time designing this myself, and then decided–I should see if there is a plugin for that.
Sure enough, there is yours, and it does everything.
I, too, would like filter functionality, so I have two questions:
1. What can I do to be alerted when that solution is available?
2. Is there anything I can to do to help (beta test, donate, etc?)
Hi Thomas,
thanks for your comment! Nice to hear that you like the plugin!
Regarding your questions:
1. Actually I published the filtering extension today :-) You can have a look at it here.
2. Of course feedback to it is always welcome. I’m also always happy about donations, as they allow me to spend more time working on the plugin and on Extensions, and giving support.
Best wishes,
Tobias
Hi, I’m trying to use your plugin. Sounds great, but to operate with another one, Shrink The Web Thumbnails, I have a problem.
Who is blocking it? Is it yours or is it them or is it WP?
I’d like to put a Thumbnail in a cell.
When using their shortcut in a table, the shortcut is not parsed. I just can read the shortcut.
Regards,
Cedric
Hi Cedric,
I have taken a look at that plugin and the problem is, that they are not using the integrated WordPress Shortcode API, but some custom method to find Shortcodes in posts or on pages. Therefore their Shortcode is not recognized within tables.
However, fixing it is easy. Just put this line of code in your theme’s functions.php (or create a WP-Table Reloaded Extension for it):
I’m having problems with the table.
In column 1, I have a 95×95-image, I set it as 98 or 100 and it’s just all over the place… Seems like they’re set then I change another one and another one goes crazy on me.
I’ve added this
"bAutoWidth": falseto the Custom Commands, not sure what I’m doing wrong.Hi,
thanks for your comment.
The code looks fine, so it is hard to say, why it’s not working, without seeing the actual page.
Can you provide the URL to the page with the table?
Also, please try adding this to the CSS:
Best wishes,
Tobias
Here is the CSS code, I put in:
Is this right? It doesn’t seem to be working at all.
Hi Shane,
I don’t know what you are trying to achieve, and unfortunately you also didn’t provide a URL of the page with your table. So, it’s hard to say if the code works or not.
Anyway, There are at least two mistakes in your code:
The first selector
.wp-table-reloaded.centerwill never match, and doesn’t really make sense. Are you trying to center the table on the page?Also, in the second CSS section, there’s a little typo: You forgot a “;” after the
font-weight: bold. If you add that, that part of the code should work.Best wishes,
Tobias
I figured, I was doing something wrong, I’m really new at this CSS business!
Anyways, I’m trying to center my table on the page. What’s the code that I need to put in to achieve that?
Hi Shane,
don’t worry, we’ll find a solution :-)
Have you taken a look at the question “How do I center a table on the page?” in the plugin FAQ?
That should get you started.
Also, your previous code is not “wrong”, it just has those tiny mistakes in it. If you remove the “.center” from the first selector and add that missing semicolon as mentioned in my previous comment, you should see first results.
Also, please provide the URL of the page with the table that you are trying to center on the page. That way, I can help you much better, because I can see if there are actually any conflicts in the CSS coming up, i.e. between the plugin’s and your theme’s CSS.
Best wishes,
Tobias
My table is right on the front page of http://www.texasholdemkings.com that I’m currently developing. I just want to be able to center it on the page.
also -
How do you manipulate the top row where the column titles are listed? I’d just like this to stand out more – I want to recolor the boxes and the text.
Hi Shane,
I checked out your site: That table looks centered to my, as it spans the whole width of the content area. So everything seems to be ok there.
You can re-style the column heads, too. Please have a look at the question “How can I change the background color of the table head?” from the plugin FAQ, which explains how to change the background color. You can then also add further CSS into those selectors, i.e. for a different text color or font, just like you are already doing with the regular table cells.
Best wishes,
Tobias
Hello Tobias,
Trying out your great plugin, my application requires a few thousand rows of data daily. I noticed issues when trying to pull in a table of more than about 1000 rows. Am I asking too much, pulling in this much data daily? It would also be nice to merge tables into a single archive table as they age… Thanks!
Hi Drew,
thanks for your question. Unfortunately, I don’t yet really know why that happens. There is no limit within the plugin itself that limits the number of rows. So, I believe that it is a server related issue. Either your memory or script time is not sufficient, or your server has the Suhosin PHP extension installed, which is known to make problems (see here).
Also, I’d like to know how exactly you are “pulling” your data. Are you using the import? If yes, which method and which source? And how exactly do you have issues?
Regarding the merging: This doesn’t really seem necessary to me. Why don’t you just put both Shortcodes on the page where the tables shall be shown? I also doubt that this will be useful to a lot of people, so I’m not yet convinced on it. There might also be issues coming from that, e.g. if the table’s don’t match in size and stuff like that.
Best wishes,
Tobias
Appreciate the quick response Tobias… I will look deeper into the server-side resources available, the site’s on a shared-server (perhaps in a VM), but I also notice less issues using IE than Firefox (current versions), FWIW.
At about >1000 rows, the browser will hang when viewing the table, or updating the Table Options (such as “Display description above table”). IE will eventually timeout, where FF will be a hung process that needs manual termination. There are 3GB of RAM in the client PC.
Currently I’m manually importing data nightly via CSV files, broken into smaller chunks, as not to trigger limitation issues. Eventually I would like to automate/script this as much as possible.
As to the archive, the goal is to have search results return matches from all tables (historical data). The columns/types of data will remain consistent over time.
Current growth is +3 tables a day. Output is currently done with 1 post per table. This method works but makes searches cumbersome.
If I use a page for all tables, I get too much data loading on the page, before the tables are shrunk down to 10 lines. This concern would also apply if an “archive table” needed to be posted, as opposed to merely search-able…
Hi Drew,
ok, now I understand better. This doesn’t really sound like the Suhosin problem anymore. It sounds more like bad luck. Most browsers seem to get into trouble when there are many textfields on a page. I don’t really know why (3 GB of RAM should be totally enough), but this issue also happens to me and other people – if I want to deal with tables larger than 1000 rows.
Unfortunately there’s nothing I can do about this really. I might add some sort of pagination to the “Edit” page, but don’t know yet, when I’ll be able to add that feature.
Anyway, after reading your other requirements/ideas, you might probably be better of with a custom solution, that uses its own database table instead. You should not have problems with the textfields then and you gain more possibilities for the automated import (as you can use SQL queries). This would also “fix” that issue with the archive tables. However, you would need custom programming to pull the data from the database, obviously.
Best wishes,
Tobias
Hi, here is the Simple Chinese webpage for this plugin. It’s not been completed yet. But I don’t know how to make a hide-expand-effect in the page like yours. Could you give me some tips, please?
http://cnzhx.net/wp/wordpress-plugins/wp-table-reloaded/
Hi,
very cool! Thanks!
The hide-expand-effect is described in this blog post: http://tobias.baethge.com/2009/07/expandhide-accordion-feature-explained/
Best wishes,
Tobias
Thank you!
Your instant reply gave me such a surprise.
Hi Tobias,
We kinda got stuck with not being able to size the column widths. Frustration led to giving up on that table.
We did exactly as outlined in the FAQ section – pasted the CSS code and associated it with the proper table, added the specified code to the DataTables JS library. But no matter what we do, the column width does not change in any browser or any computer.
Any suggestions? What could we be doing wrong?
Thanks Tobias. Please help if you can.
Reuben
Hi Reuben,
I’ll be happy to help of course!
I had a look at your site, and the first thing I noted (by using the W3 HTML Validator) is, that you have put the table (and the text above it) inside a
<h2>heading element. This might be one reason that the CSS is not working. Please have a look at the heading “PARTICIPATING PARTNERS” and fix the HTML around it. (This is best done with the “HTML editor” in WordPress.)Then you might also try adding this CSS code to the one you are already trying. That will tell the table to not span the entire page, and that may lead the browser to actually obey your column widths:
Best wishes,
Tobias
Okay. I got it to work. I ended up using the CSS code you gave above, but I changed it from “auto” to the exact px value of the table, then I made the column widths add up to the table width.
Thanks Tobias. Donation coming in a few minutes.
Hi Tobias! I have another question for you:
Alright here is my code for now, after I made the fixes:
This is what I want to happen, and I’m not sure enough about CSS to make sure this is how to make the code, so you’ll know better than me:
- I want my table to be centered on the page and all the text to be centered.
- My table headers to be a dark blue color and the text in the headers to be white.
- everything in column D to have a dark blue background and red text.
All my tables will probably be the same, so I’m not worried about the table IDs.
Did I do this right? Thanks again for all your help.
Hi,
you had it almost right again.
This time, the issues were: The color attribute is just called “color” and not “font-color”. Also, the selector for the column is not “column-D”, but “column-4″ (they are indexed with numbers, just as the rows are).
I adjusted your CSS code in your comment. Can you try that code again? I can’t spot further errors in it and it should work this time.
Best wishes,
Tobias
Thanks!
I just checked things over, everything looks good except the background on what would now be column 5 (I added another column). I want this to show up as a dark blue background. Did I do this right in the CSS code?
Hi Shane,
you did everything right. There’s on tiny thing again however, and that’s the priority of which CSS is used in case of a conflict. Currently the browser will use the background color defined for the rows, as it values it higher than that of the column, as you want it.
That can be easily changed, by adding the
!importantto the CSS however. Just replace the current CSS for the column background color with this:Everything should then work as you want it :-)
Best wishes,
Tobias
Thanks a lot for the nice plugin!
Is it possible to hide/filter rows with a checkbox?
I would like to show/hide table rows with multiple checkboxes.
Thanks a lot!
Marnix
Hi,
thanks for your comment.
Unfortunately I don’t really know yet where you want that functionality. You can hide certain rows on the “Edit” screen already. Is that what you want?
Otherwise, please explain a little more what you are trying to do.
Thanks!
Tobias
Hi,
I would like to use checkboxes on my website and use them for filtering rows.
Example: http://www.picnet.com.au/resources/tablefilter/demo.htm
You can use checkboxes at the top of the example.
Thanks again,
Marnix
Hi Marnix,
thanks for the link, that looks like a pretty cool script!
From the view of WP-Table Reloaded, there’s nothing that speaks against such a feature, however it is not integrated by default. It should (taking the examples, especially Example 2) on that page, be easy though, to add that kind of filtering to a table that was generated by the plugin. All you need to do is include the scripts, the checkboxes and a custom call to the JavaScript function.
WP-Table Reloaded provides plugin hooks to integrate the calls seemlessly.
By the way: The included DataTables library (http://www.datatables.net) offers something similar maybe: It has a fnFilter API function that will do the filtering. You also would only need to add the checkboxes and some code to make the clicks on the checkbox trigger the filtering.
Best wishes,
Tobias
Hi Tobias,
On the Demo site you have a table with a search function. Can you tell me how you install this for the table?
Many thanks
Peter
Hi Peter,
thanks for your question.
That functionality is actually integrated with the plugin and should be enabled by default (depends on when you installed the plugin). In case it is not turned, you can easily do so, by selected (and activating) the “DataTables JavaScript Library” on the “Plugin Options” screen.
Then, you’ll need to enable it for the table(s) in question on their respective “Edit” screen.
Also (depending on your theme), it might be necessary to add a call to
wp_footer();the the footer.php of your theme.Hope this helps. If not, please provide a link to the page with the table in question, so that I can take a look at it.
Best wishes,
Tobias
Just started usig your plugin, Tobias, it’s really good! I have an enhancement request, though: Could you add an option to make the first column of the table into
<th>elements? I know you can style.column-1to look like a<th>, but I’d like to pick the right element if I can.Hi Chris,
that option does actually exist. It is pretty much hidden however, because I did not create a checkbox for it in the backend, because most people will never want use it.
It is only accessible with an additional Shortcode parameter. If you use
the first column will consist of
<th>elements.Be aware, however, that most likely the JavaScript libraries for sorting and the other stuff will not work correctly with this option.
Hope this helps :-)
Best wishes,
Tobias
Is it possible (with pagination turned off) with Shortcode or any code to pull “X” amount of rows from the table that is being shown on a page and have the rows pulled and placed in the sidebar at the same time.
So the page would show the full table and the sidebar would only show “X” amount of rows and columns from the same table?
Hi Clint,
yes, that is possible. You can have the same table on the page twice, even with one of them only showing parts of the data.
Just put the Shortcode into the page as you normally would.
For the sidebar, I recommend using a text widget (or hard code it into your theme with the template tag function). Paste the same Shortcode into the text widget again, and add the parameters that will remove the unwanted rows/columns.
That can either be the “hide_rows”/”hide_columns” parameter, or the “row_offset”/”row_count” parameter, or a combination of them. Please refer to the “The Shortcode” section in the plugin documentation for details on the parameters.
Hope this helps!
Best wishes,
Tobias
Using just the Shortcode, is it possible to remove the Filtering and Info Bar?
This is the greatest plugin…
Hi Clint,
yes, of course, that is possible :-)
You are looking for the Shortcode parameters “datatables_filter” and “datatables_info”. Just set them to false, and the Filtering and the Info bar will be gone, like:
Best wishes,
Tobias
Without adjusting the CSS, is there a method of removing all table and cell borders through the Shortcode for a specific table?
Thanks!
Hi Clint,
no, that is not possible, because the Shortcode can not really influence such aspects of Styling for tables.
But I don’t really see why you don’t want to use CSS. Is it because you have the same table on the page twice, but want only one of them without borders? In that case, the class selectors do obviously not work. Fortunately though, there also is an ID selector. :-) Have you tried that?
Best wishes,
Tobias
Hello Tobias,
your plugins is great, I used it for my clients. But I have question for you about the Poor Pigs website: When you click the zoom icon, there is an AJAX there that loads the player information. How am I going to do that on my website?
Thanks
God Speed
Hi cirex,
thanks for the question.
That is actually not a function of WP-Table Reloaded, but something I developed specifically for that website. You should be able to take a look at the source code on the page easily. There you’ll see, that the jQuery library is used to perform the AJAX request to a PHP script on the server (the script works independently of WordPress). It then returns the HTML which is again inserted into the table with JavaScript. That’s it.
Another possibility that does something similar can be seen on the DataTables download page. Here, a click on the + or – will trigger content to be shown as a new row. In that case, all data is already in the table, and no real AJAX request is performed. You should also take a look at the page source code to see how it is developed.
Best wishes,
Tobias
Hey Tobias!
I’m using your awesome plugin for a table on the homepage of my site, and just have question which I am assuming there is a simple answer to.
The site is itc4oc.com, and on my price comparison table, I want the very first cell (row 1, column 1) to have a different font/color than those in the column, and those in the table header. Basically I want to make the Price Comparison Chart be black or red or something, while leaving the two other names in the header white. Is this possible?
Hi Sam,
yes, that is easily possible with CSS.
Please have a look at the questions “How can I highlight certain cells or their content?” and “How can I change the font, font size and font color of a table?” in the plugin FAQ, which should show you how to do it.
Best wishes,
Tobias
Excellent! I didn’t think to combine using both of those commands at the beginningm since I am very new to CSS. Thanks for this great plugin! Have a good day!
Hey Tobias, thanks for all your help the last time, it’s been awesome. I’m wondering how much I can fit into the “Plugin Options” before it explodes.
I’ll be having maybe an average 4-6 tables per post, and loads of posts. Will there be problems with that much in there eventually?
With so much data in there, how do I comment and seperate my post’s tables in the “Plugin Options”?
Hi,
when mentioning “Plugin Options”, do you actually mean the “Custom CSS” section in the “Plugin Options”?
Indeed, you should not put too much of code in there, as all of it is loaded, when a user is requesting a page from your site.
Instead, you might consider putting the CSS code into a file in your theme’s folder and only referencing that file in the “Custom CSS” textarea. Then, all your modifications would go into the file. This would be an enhancement to the database and for caching purposes.
I’m however a little confused, on why you have so much code in there. Do you really need to style each table individually? Maybe you can use one of the more general CSS selectors (i.e. “.wp-table-reloaded” instead of “.wp-table-reloaded-id-3″, so that it applies to all tables)?
Best wishes,
Tobias
Hi Tobias,
Thank you for help on this problem. I have set the DataTables JavaScript Library and I believe it is enabled for the tables, still no joy.
You mentioned the wp_footer, I’m not clear on this and perhaps this is the problem.
The site I will be using the plugin is http://melbourncambridge.co.uk/history/test/. This is just a test page to set it in motion, I have 500 years of entries to put on site.
Apologies for not mentioning earlier, this plugin is going to be one of the best WordPress plugins I have come across.
Best wishes,
Peter
Hi Peter,
you are welcome!
Regarding your current problem: I had look at your site, and all indicators make me assume that it is indeed missing that
wp_footer();call.To find out, open the file “footer.php” in your theme’s folder.
Somewhere in there, you should find a line like
If it is not there, you must add it. The correct place is right before the closing
</body>tag.Could you check that?
Best wishes,
Tobias
Hi Tobias
Fantastic, poped up straight away. Sorry, I missed it.
Now, if I seem even more dense apologies. When I type a name that I know is in the list below the search box, it tells me it cannot find it. Any particular reason?
Again thanks,
Peter
Hi Peter,
no need to apologise here! That’s what a community is there fore :-)
Regarding the search: Now, that’s really odd. I don’t really know why it happens, but I assume that it is, because you are using a colspanned header row. That might break the functionality inside the DataTables library. Could you try it again, after removing the colspan from the header row?
Best wishes,
Tobias
Hi Tobias,
Not to make this puzzle any bigger, but, in removing the colspan, the search disappears. If I put them back, it returns. Currently removed.
Peter
Hi,
We just upgraded to the latest version and all of our tables were deleted!
Is there a way of getting them back?
Hi Mr M,
I actually doubt that they were really deleted. That could only happen (meaning pro-actively performed by the plugin), if you either clicked the “Uninstall” button in the “Plugin Options”, or had the “Remove upon Deactivation” checkbox enabled and deactivated the plugin manually on the “Plugins” page of WordPress.
During an automatic upgrade, nothing will be deleted by the plugin.
So, I guess it either is a database problem, or the plugin just can’t find the tables in the database anymore (although they are there).
(And you are the only person ever reporting such a problem.)
I’ll contact you by mail to start some investigation.
Best wishes,
Tobias
Something similar just happened to me. I deactivated the plugin to change the database prefix. After reactivating, all tables (3) are not found – although they are still in the database.
Nevertheless, thanks for a useful plugin.
Hi Ralph,
I’m sorry that that happened to you. Changing the database prefix for an already running WordPress is not always easy unfortunately. My plugin runs independently of the database, as it only uses the API that WordPress provides, so I can only assume that there was a problem with that.
The correct thing to do before such large interactions with the database is to create “WP-Table Reloaded Dump file” as a backup that you can then re-import if something gets broken.
If the recreation of your three tables is not too much work, I would recommend that. Otherwise, you could also email me an SQL export of the WP-Table Reloaded options from your database (should be 5 total). I can then try to restore the tables for you, if you want.
Best wishes,
Tobias
Best wishes,
Tobias
Thanks Tobias,
well, shit happens, especially if you don’t think before you act. This is what I did when I replaced wp_ as database prefix. I should have known that wp_table_reloaded will be renamed, too (like other plugins beginning with wp_).
I just re-imported the backup of my database and everything seems to work fine again.
Thanks again,
Ralph
Hi Ralph,
ok that makes sense then :-)
You should only rename the actual table names, but nothing with the tables. And of course change the corresponding variable in the wp-config.php.
(In fact, there might even be plugins that can do that renaming for you.)
Best wishes,
Tobias
Hey,
The WordPress plugins page claims this plugin won’t work with WP 2.5. Is that really correct or is it just a default value? If so, would you know how complicated it would be (for us) to make this work in 2.5? Are there large differences or just minor ones?
Thanks a lot!
Hi Brian,
thanks for your comment.
You read correctly. WP-Table Reloaded requires at least WordPress 2.8. (You might have confused it with the “wp-Table” plugin?!)
There is no possibility to make it work with WP 2.5, as makes extensive use of features that are not available in that version of WordPress.
You should really consider updating your WordPress to the latest version, instead of working with a version that is almost two years old, and contains large security holes.
Best wishes,
Tobias
Hey!
This plugin is great and I just donated to you and your work!
I’m using it on a site I just finished: http://www.langosimmental.se/djur-till-salu
Kind regards,
Magnus
Hi Magnus,
very nice usage of the tables! And thanks a lot for your donation, I really appreciate it!
Best wishes,
Tobias
Hi Tobias,
Finally resolved the search problem – as you pointed out, thank you.
Is there any way of turning off different aspects of the DataTables library, such as “Showing x of x” or “Show x entries”?
Can the “Show x entries” show more than 10 rows in a table?
Finally, is there a CSS value that would allow me to change the font size and face for these?
Thanks,
Peter
Hi Peter,
great to hear that!
You can turn of those features in the “DataTables JavaScript Features” sections (which is hidden initially) on the “Edit” screen of your table.
Changing the default value is possible by adding a “Custom Command” in that section, and is explained in the FAQ. (In version 1.7 of the plugin, which will be released on Monday, there will be a text field to make that process even easier.)
To style the elements with CSS, you’ll need to find out the used CSS classes they have, so that you can use them as selectors. Either use Firebug to find them manually or have a look at the list on the DataTables website.
Best wishes,
Tobias
Tobias, what terrific work! Tremendous! Great stuff! Thanks so much for the wonderful update of Alex’s fine plugin. I just PayPal’ed a very small token of my appreciation – have a cup of coffee and a donut on me! Thanks again!
Hi Anthony,
thank you very much for the donation and the nice words! I’ll definitely enjoy that coffee and the donut :-)
Best wishes,
Tobias
Just a minor thing, on the “Import Table” screen, the label for CSV reads “Character Separated Values”. Should be “Comma Separated Values”. Lost in translation? :-)
Thanks
Hi Martin,
thanks for your comment.
Speaking from the history of the abbreviation, you are correct. Technically, however, that would not be true for the plugin as it has more capabilities: It does not really care, what the separating character is. That could be a comma, a colon, a semicolon, a tab, a dot, a pipe, or a space, so “character” seemed more appropriate to me :-)
Best wishes,
Tobias
New problem with this recent update. First page of table looks fine, with rows alternating with odd and even classes. On the next page however, all rows are colored. A quick check with firebug reveals this code is being rendered:
Both odd and even classes are being applied to the row.
Click to the next page, and all is restored. Click again to page 4, and the problem returns.
Just updated to the latest version and now I get this message, when I go to a page with a table on my website.
“DataTables warning: Unexpected number of TD elements. Expected 65 and got 38. DataTables does not support rowspan / colspan in the table body, and there must be one cell for each row/column combination.”
I’m using Firefox and WP 2.8.6.
Hi Jason,
thanks for your comment.
It looks like you are affected by some changed behavior of the DataTables JavaScript library.
Please refer to http://wordpress.org/support/topic/377401
Best wishes,
Tobias
Hi Tobias,
First of all, amazing job! I’m so happy that I found your plugin and – more importantly – even happier that the world has people like you who can make such beautiful software! Thank you so much!
I have a question that I believe hasn’t been asked before in the comments: I would like to have a cell’s background change color based on its negative or positive status. For example, in this table – http://gmauthority.com/blog/2010/03/by-the-numbers-february-2010-gm-india/
I would like the rows that have a negative volume % to turn red, while those with a + turn green.
Is that possible? Thanks so much and keep up the awesome work!
Hi Alex,
thanks for your nice comment.
There’s no dynamic method for this integrated with the plugin, so you would have to do that with some custom JavaScript. E.g. you could loop through all table cells with jQuery, check if the value is negative and if that is the case, add a CSS class to the cell, that will change the background color.
This would require a few lines of coding however.
Instead, as your table seems to be rather small, you can of course change the background colors manually.
For that, please have a look at the question “How can I highlight certain cells or their content?” in the FAQ, which explains how to do it for single cells. Basically you’ll just need to repeat that step for all your cells, with one command for the green cells and one for the red ones.
Hope this helps.
Best wishes,
Tobias
Hi Tobias,
Thanks for the suggestions. I think your first suggestion would work best for me (JavaScript) since I will be creating and publishing about ten new tables per month, most of which will be longer than the one you saw.
If I would have to add a CSS entry for every table I published, this would become daunting and maybe even clutter the style sheet.
Would you be interesting in doing this work for me (for pay, obviously)?
Thanks,
Alex
Hi Alex,
thanks for your offer. I’ll contact you by mail to discuss details.
Best wishes,
Tobias
Love the table tool as it works for simple tables, but sometimes (ok, a lot) I have a mySQL data table that is read by different apps on different sites, etc. It would be a cool thing if I could map the WP-Table Reloaded into the data table and say “Read this field here, this field here, that one there” and it would render on a WP page/post from the table data instead of re-entering ad updating the table.
Just something to consider.
Hi Rufus,
thanks for your suggestion. I could imagine that you could achieve this with some PHP (that can be included with a WP-Table Reloaded Extension), which makes a call to the database.
Integrating this into the plugin does not really sound possible. First of all there are just way to many possibilities how this process could look like or be performed. Also, it is totally out of the scope and the actual purpose of the plugin, which is to be able to easily edit and display HTML tables.
If something like complex database calls is required to obtain the data, you are better of with a custom script that fetches and renders that data, I believe.
Best wishes,
Tobias
Aloha,
erstmal ein großes Lob für ein klasse Plugin. Genau das Richtige für mein neues Projekt, wenn ich da nicht ein Problem hätte.
Mit Firefox erscheinen bei mir keine Sortier- und Suchfunktionen für die Tabellen (also es wird nur die Tabelle angezeigt). Mit IE und Chrome hab ich die Funktionen jedoch. Ein paar Kolegen haben mir das auch bestätigt. Ich benutze ein ganz frisches WP 2.9 und keine weiteren Plugins sind aktiviert.
http://fuzetsu.cwsurf.de/
Hi Martin,
vielen Dank für deinen Kommentar.
Das ist mal wieder eines dieser Probleme, bei denen ich überhaupt nicht verstehe, warum sie passieren…
Gerade Firefox hat sich eigentlich bisher als recht tolerant erwiesen, in Fällen in denen der Internet Explorer schon längst ausgestiegen ist…
Ich habe keine endgültige Lösung und weiß leider auch nicht, woran es auf deiner Seite liegt, aber mir sind beim analysieren der Seite zwei Kleinigkeiten aufgefallen, an denen es liegen könnte:
- Du hast einen Banner über ein <img>-HTML-Tag eingebunden, allerdings fehlt diesem der schließende /, so dass dadurch Firefox vielleicht aus dem Tritt kommt. Diesen Schrägstrich mal bitte noch einfügen.
- Außerdem beinhaltet deine Seite ein JavaScript, das auch irgendwas mit Ads zu tun zu haben scheint. Dieses wirft bei mir manchmal einen Skriptfehler aus. Möglicherweise stoppt Firefox dadurch die Skriptarbeitung und DataTables funktioniert deswegen nicht. Könntest du dieses Script testweise mal rausnehmen?
Schöne Grüße,
Tobias
Danke,
sowas in der Art habe ich mir schon gedacht und da ich den Script nicht ändern darf vom Webspace-Anbieter her, ziehe ich jetzt mal endgültig auf einen Kostenpflichtigen um und dann sollte es gehen.
Vielen Dank nochmal =)
First, allow me to say this is an excellent plugin and it’s something I have yet to really experience any error with.
I do have a question for you, however. Some of my content is a collection of scouting reports on baseball players in a list-like fashion. I use your plugin simply as the header for each player with the top line the player’s name, age, etc. and the bottom line where they played the previous year and where they were drafted.
I have many reports to complete, so I’ve been using a lot of small tables. Five tables are used in 30 articles and ten tables are used in another 30 articles. I have gotten through maybe half of those articles so far. But I’ve been teedering on the line of using too many resources on my server and I’m wondering if it’s possible that these tables — because there are so many of them — would be a cause for the high amount of resources being used on my server.
I know there are some plugins that are contributing to the problem and I’m simply trying to get down to the bottom of which ones are causing the most problems.
Hope I explained my issue clearly enough and I look forward to hearing your response. Thanks.
Hi Alex,
thanks for your comment!
I can really understand your concerns regarding server performance. In theory, many large tables could of course lead to a high amount of used resources (just like any other content would, if it is a lot).
Speaking from your description and my experience however, I can tell that you are not really having a lot of tables (meaning there are people with more :-) ). Also it does not sound that your tables are that large.
So, while it would be possible that the tables are slowing down your server (in which case it’s probably not configured too well), I don’t really think they are.
As it sounds that your content is rather “static” and does not change often: Have you considered using a caching plugin? That should help decrease the server load (no matter if it were caused by WP-Table Reloaded or some other plugin)?
Best wishes,
Tobias
Hi Tobias,
Thanks a lot for your great work.
I manage a site for a choir and I would like to use WP-Table Reloaded to list our songs.
I use the extension “Audio Player 2.0″ which allows you to listen a .mp3 file.
It’s very easy to use with a simple command: [audio:http://www.yourdomain.com/path/to/your_mp3_file.mp3]
You can see the results of Audio Player on http://wpaudioplayer.com/whatsnew by clicking the arrow under the title “The mp3 player”
Do you know if there would be a way to use a command ‘Audio Player’ in a cell of WP-Table Reloaded?
Best regards,
Thierry
Hi Thierry,
thanks for your question.
Yes, what you want is easily possible. Actually such a feature (the evaluation of such “simple commands” as you call them) is already built-in – if the other plugin uses the standard WordPress version of them, called Shortcodes.
Audio Player has its own version of “simple commands”, so we need a small line of code to make them work.
All you need to do, is: Copy this line
into the file “functions.php” of your theme. (If you don’t have such a file, just create it and wrap the line in PHP tags (
<?php and ?>).Hope this helps! :-)
Best wishes,
Tobias
Dear Tobias,
Your are a magician, it works perfectly!
Thank’s a lot to for working on Sunday! :-) And for your really 1st class service!
With all my admiration and thanks.
Best regards,
Thierry
How would I go about centering the text in the cells?
I have an image on the far left column and a few columns with text, though with some it looks akward with the text at the top and hard to see.
How I can center the text top to bottem and left to right so it’s more in the middle of my image?
Hi,
thanks for your comment.
What you want to achieve should be possible with a little CSS, that just needs to be pasted into the “Custom CSS” textfield on the “Plugin Options” screen of WP-Table Reloaded.
(Change the “5″ to your table’s ID.)
As you are using images, it is possible that this is not yet sufficient, but it is a good first try. If it does not work yet, please provide the URL to the page with the table, as I can then make more concrete suggestions.
Best wishes,
Tobias
Hi,
I am already using the excellent plugin but have a weird request. Is it possible to install a second version of the plugin into a second directory. For example at the moment I am using the plugin to show data of each show visit therefore table ID 1 is for my first visit, table ID 10 for my tenth visit, etc. It is important to keep the IDs aligned to the show number, as I need to be able to quickly find visits, etc.
I now want to put some more tables on, but this time for the different casts over the year and call this cast ID 1, cast ID 2. I know I could just create a new table in the original plugin, but this would then effect the ID count, hence why I want to keep the two sets of tables apart.
If its not possible to run two versions, in separate directories, is there a quick and easy way of duplicating the original table up to say 2,000 which would then allow me to use 2001 as cast ID 1.
I hope this makes sense.
Regards
Hi Perry,
thanks a lot for your question.
Technically, it would be possible to create a second installation of WP-Table Reloaded in a second folder. Unfortunately, it requires a lot of work, because quite a few function names, variables and so on have to be renamed in the second folder. I have done it with an older version before, but I’m not particularly envy to do it again. There is also a problem arising from that: You can not update that second installation as easily as a regular one.
Now, I have a suggestion that should actually do what you need – if I understood you correctly -, without needing a second installation:
Have you seen that you can change a table’s ID on its “Edit” screen? A table’s ID can be changed to any ID that is not yet taken. With that, you should be able to change the IDs of your visits with 1 through 10 and so on. (If you want to change an ID to one that is already taken, just change that table’s ID to a temporary dummy ID first.) Additionally, you could change all cast’s IDs to 2001 and so on.
So, basically only the ID of a new table will be out-of-sync initially. But then you can just change it to your desired ID, depending on whether it is a “visit” or “cast”. Does that make sense to you?
Best wishes,
Tobias
Hi Tobias,
I have decided to do what you suggested and it works really well, so thank you.
One request is: Can you tell me, what CSS I need to put in a span class to get a table row to have the same background style (font and color) as the header? If you look at http://www.wewillblogyou.org/?page_id=224, you will notice “Pop” is in white with a red background as “Pop” is the header row. I need to be able to manually choose another row – “Kassohgi” – to have the same attributes. I can’t use the CSS example in the FAQ, as this would cause the other tables (visits) to suddenly change.
I am not that good on CSS so would apprecaite any help.
Regards,
Perry
Hi Perry,
thanks for your follow-up! Good to hear, that my suggestion worked!
Regarding the styling: Unfortunately there’s no possibility to use a span to change the row’s background color (because the span “lives” inside the row and can not influence its “parents”). However, what you are trying to achieve is not too hard with some CSS. The first thing I need to ask: If “Pop” is the header, but “Kassohgi” looks the same, they basically have to same “priortity” or “magnitude”, right? If that is the case – and there’s nothing really making “Pop” a “header” -, I suggest the following: Uncheck the “Mark first row as the table head” checkbox (so that all rows “live” in the table body and there’s no header anymore). Then, try this CSS to style the rows:
This code will style the “Pop” and the “Kassohgi” rows in the same way as the header was before. And there’s one additional thing to note in that code, which is the answer to your assumption about the CSS examples: Note the
.wp-table-reloaded-id-51. That is the specific selector for the table with the ID 51. The styling commands will only apply to matching rows (1 and 3 in this case) for table ID 51. That way, you can style all tables differently (if you wanted to), and you could use the examples from the FAQ, if you adjust that part of the code.Hope this helps :-)
Best wishes,
Tobias
Hi Tobias,
Many thanks for the swift and prompt reply, which has sorted the background color out. I can easily change the font and weight styles myself.
I understand this will work on table ID 51 (which will later be renamed 2001). There will be 2001 – 2010 and then a new one each year. Would I need to have a line in the CSS for each year (2001, 2002, etc.) or is there a way to group it for any table ID starting with 20*?
If not, it’s not the end of the world, but I would obviously like to make it as easy as possible.
Regards,
Perry
Hi Perry,
you are welcome for the response of course! :-)
Yes, you will have to add a new line for every table ID (and for every row of the table). There’s no method in CSS that I’m aware of, that supports such things as you want them, unfortunately.
You could however use a small custom WP-Table Reloaded Extension. Using the filter hook “wp_table_reloaded_table_css_class”, you could add a custom CSS class to the table. Then you could use that CSS class as the beginning of the selector. You would lose a little bit of flexibility and actually you would need to maintain a small list of those table IDs that shall get the custom CSS class applied. So really, this would be about the same amount of work, due the programming maybe even a little more.
Best wishes,
Tobias
Very nice plugin! You have solved the issue of including tables (and Excel sheets) into WordPress for a lot of people. So on behalf of everyone, thank you!
I’ve got a question that may be more of a feature request.
Is it possible to use the Shortcode or another method to include data from a specific row? I know I can use the row_count method, but I want to use the data in a specific row in a sentence format similar to:
The leader thus far is [row 1, cell 1] who has won [row 1, cell 2] events thus far this season with $[row 1, cell 3] in winnings.
Hi Bill,
thanks a lot for your nice comment.
Unfortunately, what you are looking for is not readily integrated into the plugin, although I understand the need for it.
But, lucky as you are, there is a simple solution, with just a few additional lines of code :-)
All you need to do, is to take the following code and paste it into an empty file for a WP-Table Reloaded Extension.
(I should actually present this as a real WP-Table Reloaded Extension, I guess…)
You will then have a new shortcode, like this:
This will return the content (and just the content) of row 5, column 4 of table 123. (I shortened the parameters to “c” and “r”, to have smaller Shortcodes.
(I did not include any checks though, if the table/row/column really exist, so in those cases you will get a PHP parse error.)
This should be what you want though :-)
Best wishes,
Tobias
Works beautifully. Thanks!
Could the function (or a separate function) also pull a random row from the table keeping in mind that the table could have 1 to 1000 rows?
I envision this being useful to spotlight a customer, employee or a team in the standings, etc.
Hi Bill,
no the code from above can not do that, here’s another function though, that can :-)
It can just be added to the code from above (or used alone). The code provides another Shortcode (I didn’t want to mess around with the other code, just to integrate it.), like this:
It basically has three differences: the name (obviously), no “r” parameter anymore (as that is chosen randomly from the table), and a new parameter “number”, which basically is an identifier to the random row, so that the same random row can be used to obtain different columns from it. Because of that identifier “number”, you can actually use the Shortcode for more than one random row. If you leave out the “number” parameter, all calls to the Shortcode on the page will use the same random row. Do you understand what I mean?
Best wishes,
Tobias
Thanks for providing the code to pull a random row from the table.
I did not understand the “number” parameter. I didn’t see a difference by setting it to 1 or leaving it empty. Can you provide an example of what to expect?
Also, the randomize feature has pulled the header row. Is it possible to exclude the header row from the array?
Thanks again.
Hi Bill,
you are welcome! :-)
Don’t worry about the “number” parameter. It’s likely that you won’t need it, but I added it just to be one the safe side later. All it does, is to allow to distinguish between different random rows. For example, if you want to pull two (or more) random rows, the Shortcodes that belong to the same random row (as they are pulling different columns from that same row) need some kind of identifier to pick the right random row.
And the “number” parameter is that identifier. You will see what I mean, if you take the phrase you are using (that with the Shortcodes in it) and place it on the page again. If you don’t change the “number” parameter, you will see an exact copy of the phrase. If you however change the “number” parameter, you will get your phrase with a different random row. Does that make sense?
Regarding the header row: You are right, there is (was :-) ) nothing in the code to prevent that from happening. I added a check to the original code, so that it should no longer pull the header row now.
Best wishes,
Tobias
Three quick issues that I’m having with the plugin.
1. I’m trying to export my databases to CSV, but it only outputs the first 20 lines. It works fine exporting in XML though. Suggestions?
2. In future versions, could you please, when listing tables, give an option to get rid of the 10 table pull-down and default to showing all? It’s a pain when going through tables to keep selecting 100 every time.
3. Is it possible that, when using a header or footer row, that sorts would not move those rows? It’s a pain, even though the header is selected, to have to put it back at the top every time I do a sort. Something for future versions, I suppose.
Otherwise, great plugin, I’m very happy with it.
Hi Cephus,
thanks a lot for your comment and especially for your suggestions!
For the CSV export problem: That sounds weird, and I don’t have an idea what might be causing it. Can you check if you are using PHP 5 and if your PHP memory limit is higher than 32M? (And if either of those is not the case, eventually update/increase it.) If that doesn’t help, please email me both the CSV and the XML file, and I will take a look. Maybe I can find something that is causing the problem.
For your suggestions: Nice ones! There is a possibility to completely turn of the pagination (and sorting) on the List of tables, using a plugin filter. If that would be an option for, just let me know and I’ll get the necessary code ready for (as a WP-Table Reloaded Extension).
For the sorting with header/footer row: You are refering to the sorting on the “Edit” screen here, right? Don’t really know why I forgot about special handling of those situations, but I’ll add it to my list of enhancements. Thanks!
Best wishes,
Tobias
Yes, that would certainly be acceptable, it’s just an annoyance, putting out a filter that would fix it would be perfectly fine.
I went and checked on my system and yes, I am using PHP5 and my memory limit is higher than 32M. It’s not like this is a large file, the CSV comes out at 1.7k and the XML at 4.33k. I’ll go ahead and email you the two files so you can take a look and I’ll keep testing it on my side.
I just had one of my databases randomly truncated and I lost a ton of data, it went from about 100 lines down to 17 for no reason I can find. It wasn’t cut off at one specific point, I lost data randomly throughout the file. Gotta figure that out, it’s never happened before.
Great plugin. It was just what I was looking for.
I’ve installed the extension that pre filters the rows. I can get it to work fine so long as the data I am trying to filter is not part of a link.
For example, if a number of my rows have this data in them –
<a href="http://www.google.com">Google</a>then I cannot get the filter to filter out “Google”. If I select the entire link code then it includes all rows that have a link in them regardless of where the link is pointing or the name of the link.Am I doing something wrong?
Hi Garry,
thanks for your comment.
That is a limitation of the current code, mainly for speed enhancement reasons (it is easier to check for the complete cell content than just for parts of it). I don’t really know though, why the complete link filtering should not work. Are you creating them manually or with the Automatic Link conversion Extension?
Here’s a suggestion that should hopefully solve your problem: Add a new column to your table (e.g. as the very first one), but hide it (using the checkbox/button). Then enter your filter word (i.e. “Google”) into that cell and use that column for the filtering. Does that sound reasonable?
Best wishes,
Tobias
Thanks for your quick response.
I have done some more investigation and have found that it is the presence of the second set of quotation characters that is causing the problem when searching for the entire cell contents. For instance, if I were to arbitrarily enter “xxxx”xxxxxx”xx” (exactly as I have written it here) as the filter, then the table would render all entries. Likewise, any filter based on a cell with link code will render all entries.
Adding spaces around the link name e.g.
> Google </a>as opposed to >Google</a> and then filtering on “Google” will not render anything, nor will trying to filter on any subset of a link that does not include the second set of quote marks.I’m going to continue with the suggestion you made (use hidden columns) but that will mean three extra columns of data to manage in my application. However, if you have a quick thought on what might be happening with the code I would be most interested.
Many thanks for your help with this issue. And, once again, thanks for the great plugin.
Garry
Hi Garry,
thanks for the follow-up and the further investigation.
Very nice find with the quotation marks! (Stupid me, haven’t really seen those initially…) They are the reason why the filtering for the complete link is not working: WordPress will just thing that the Shortcode argument is closed by the first quotation mark in the link. (It can not distinguish between the quotation marks in the string
filter="<a href="http://www.google.com">Google</a>".). Does that make sense?So, you could try to use a single quotation mark (‘) in your links, that should actually work then.
Otherwise, the only thing seems to be the hidden columns.
Best wishes,
Tobias
Absolutely fantastic! The single quote marks worked. Thanks for hanging with me on this one.
On a related note, I noticed another problem that may be related to Onur’s problem. If I pre-filter or use the search function on a large table a gap may appear between the table and the text below.
For instance, if I have a table with 20 items and I filter it down to one, then a gap of approximately 160 pixels appears between the bottom of the table and the text that follows beneath. If 2 items show, the gap is approximately 130 pixels. And for each item that is added the gap will reduce by about 30 pixels until there are 7 items in the list.
I did uncheck the “Use DataTables library” button and the gap disappeared, but of course all dynamic functionality disappeared also.
Is there a workaround for this problem?
Thanks,
Garry
Hi Garry,
good to hear that the single quotation marks worked :-) And of course you are welcome for the help.
Regarding that gap that you and Onur are experiencing:
That is not really a bug, it is more the intended behavior of the DataTables library. The gap is the result of the CSS that is applied to the table (or technically more precise: to the surrounding
<div>). The script sets a minimum height to the table, so that there won’t be any (or at least less) jumps on the page, if you apply one of the dynamic features. If that CSS were not there, the table (and the text below it) would move up and down, depending on the result of the sort, filter or pagination. This is also pretty undesirable, so that’s the reason for the minimum height.If you wanted, you could turn it off, but you might then experience those ugly things. Some “Custom CSS” like this should do it (untested though, you might also try a custom value, like
200px):Best wishes,
Tobias
Hi Tobias,
I have just activated and tried your unique plugin. I managed to add a table on this page: http://www.murefteguvenemlak.com/2010/03/25/tuna-sitesi-daire/
But as you can see on the post, whereever I put the shortcode [table id=1 /], a blank area appers. I tried to put the table on top and bottom of the post, deactivated some other plugins, but couldn’t solve the issue. I will be glad if you have a look at it. Maybe you already have a “one word” solution.
Thanks a lot.
Onur
Hi Onur,
thanks for your comment.
That blank space is added by the DataTables JavaScript library (which for some reason does not work on your site, probably a conflict with your theme).
To remove the empty space, just uncheck the “Use DataTables library” checkbox in the “Table Styling Options” on the “Edit” screen of the table.
Best wishes,
Tobias
At last I got rid of those meaningless spaces below my tables :) Thanks for the quick response. This is the best and the only remedy to the wp-Table problem.
Best wishes,
Onur
Awesome plugin!
Thanks for helping ThierryG7 out with the Audio Player 2.0, I was having the identical problem and now I can add mp3s to the table. Thanks!