PHP use of Plugin WP-Table Reloaded

The plu­gin “wp-table reloaded” is an excel­lent plugin.it has good GUI for man­ag­ing dif­fer­ent tables( dif­fer­ent num­ber of columnns and rows),managing data — adding/updating/deleting/hiding.its easy to use-just add in your post the short­code of “[table id={}/] and that’s it.

wp-table reloaded has also nice GUI man­ag­ment for CSS’ing it.althought this spes­dific fetures some­tine fails to work , thus you need to go straight to the plu­gin core CSS and change it there, its good enought.

I had a sim­ple task which i used wp-table reloaded plugin.i needed to show a list of human point of views.for that i cre­ated a table with one col­umn , and imported (another great fea­ture) a CSV file.2 min­utes work

BUT,

the default pre­sen­ta­tion of the table is done with <table/td/tr> HTML tags, and i had to show the table using <UL/LI> tags.

So after going in the core plugi code, i finally came up with the solution.

note:it might be eas­ier but from the doc read­ing from the wp-table reloaded site i didnt saw any­thing to solve it

So , here is src :

if ( !defined( 'WP_TABLE_RELOADED_ABSPATH' ) ) exit; // no direct loading of this file
$WP_Table_Reloaded_Frontend = new WP_Table_Reloaded_Controller_Frontend();
$table = $WP_Table_Reloaded_Frontend->load_table( 2);
$rows = count( $table['data'] );
$i = 0;
while($i&lt;40){
$row =  $table['data'][ $i ];
$cell_content = $row[ 0];
echo "".$cell_content."";
$i=$i+1;
}

lets get thru it:

first we need to cre­ate an instance of the Table_Reloaded_Frontend class

$WP_Table_Reloaded_Frontend = new WP_Table_Reloaded_Controller_Frontend();

this line is get­ting the spe­sifc table :

$table = $WP_Table_Reloaded_Frontend->load_table( 2);

then to get the num­ber of rows in the table

$rows = count( $table['data'] );

And after it sim­ple iter­a­tion in the rows retriev­ing a spe­sific cell

$i = 0;
while($i&lt;rows){
$row =  $table['data'][ $i ];//get the current row
$cell_content = $row[ 0];

//get the first columc.if neededd use a second iteration like row[j] whic j runs //the number of columns

that it.after it you can use the $cell_content vari­ble in html

Con­clu­sion:
wp-table reloaded a good plugin.in this arti­cle we show how to use it thru its api.

Pop­u­lar­ity: 100% [?]

Share

Related Posts

  • No Related Post

Comments

  1. Fol­low­ing my mon­i­tor­ing, mil­lions of per­sons on our planet receive the mort­gage loans at var­i­ous banks. So, there is a good pos­si­bil­ity to receive a car loan in every country.

  2. Attamutle says:

    Buy cheap Paragon Disk Wiper 2010 Oem Soft­ware Ver­sion
    Buy cheap AutoDesk Auto­CAD 2010 Oem Soft­ware Ver­sion
    Buy cheap Araxis Merge Pro­fes­sional 2009 3750 Oem Soft­ware Ver­sion
    Buy cheap Adobe Acro­bat X Pro 10.0 Oem Soft­ware Ver­sion
    Buy cheap DeLorme Street Atlas USA 2009 Plus Oem Soft­ware Version

    online cheap Adobe in Daly City

  3. I have been fol­low­ing posts. I per­pet­u­ally find you arti­cles enlightening.

  4. love says:

    Indi­vid­u­als meant for great­ness will be tested and have to take care of road blocks while peo­ple that are des­tined for medi­oc­rity will have it effortless

Speak Your Mind

*

Please leave these two fields as-is:

Protected by Invisible Defender. Showed 403 to 13,139 bad guys.