Title: dynamically populate cell contect
Last modified: December 19, 2016

---

# dynamically populate cell contect

 *  Resolved Anonymous User 13716511
 * (@anonymized-13716511)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/dynamically-populate-cell-contect/)
 * I would like to use this plugin in a template file.
    I’ve created a table, id
   =3. With column names. I would like to populate the data on the table using php
   in the template file, pulling data from acf fields in a custom post type. Is 
   this possible using this plugin?
 * I tried to find a starting point and used the following code but nothing appeared
   on the table.
 *     ```
       $table_id = '3';
       $table = TablePress::$model_table->load( $table_id );
       $table['data'][0][0] = 'hello'; 
       ```
   
 * What is the best way to do this?

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

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/dynamically-populate-cell-contect/#post-8568974)
 * Hi,
 * thanks for your question, and sorry for the trouble.
 * To be honest, I don’t really recommend this. Your best chance probably is to 
   use the `tablepress_table_render_data` filter hook (see [https://github.com/TobiasBg/TablePress/blob/master/classes/class-render.php#L258](https://github.com/TobiasBg/TablePress/blob/master/classes/class-render.php#L258))
   and to overwrite the data there.
 * Regards,
    Tobias
 *  Thread Starter Anonymous User 13716511
 * (@anonymized-13716511)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/dynamically-populate-cell-contect/#post-8575791)
 * How would I use this hook?
    I tried function therapist_listing_content(){ echo“
   populate cells?”; } add_action(‘therapist_listing_content’, ‘tablepress_table_render_data’);
   but it isn’t doing anything. How do I connect it to table id =3
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/dynamically-populate-cell-contect/#post-8575924)
 * Hi,
 * I recommend that you first try to learn more about how filters work in WordPress.
 * Basically, the filter will get the current table data as a parameter, you can
   then modify it and return the new data.
 * For example, use this:
 *     ```
       add_filter( 'tablepress_table_render_data', 'LucyTech_modify_TablePress_table', 10, 2 );
       function LucyTech_modify_TablePress_table( $table, $render_options ) {
         if ( '3' !== $table['id'] ) {
           return $table;
         }
   
         // modify $table['data'] here
   
         return $table;
       }
       ```
   
 * Regards,
    Tobias

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

The topic ‘dynamically populate cell contect’ is closed to new replies.

 * ![](https://ps.w.org/tablepress/assets/icon.svg?rev=3192944)
 * [TablePress - Tables in WordPress made easy](https://wordpress.org/plugins/tablepress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tablepress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tablepress/)
 * [Active Topics](https://wordpress.org/support/plugin/tablepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tablepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tablepress/reviews/)

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)

 * 3 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [9 years, 5 months ago](https://wordpress.org/support/topic/dynamically-populate-cell-contect/#post-8575924)
 * Status: resolved