Title: insert table with php
Last modified: May 19, 2019

---

# insert table with php

 *  Resolved [millonario](https://wordpress.org/support/users/millonario/)
 * (@millonario)
 * [7 years ago](https://wordpress.org/support/topic/insert-table-with-php/)
 * Hello, I want to insert this shortcode in php: [table-cell id = 123 row = 1 column
   = 1 /]
 * How could he do it? I have tried like this, but it does not work:
 *   <? php tablepress_print_table_info (array (‘id’ => ‘1’, ‘row’ => ‘1’, ‘column’
   => ‘1’)); ?>

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

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [7 years ago](https://wordpress.org/support/topic/insert-table-with-php/#post-11548497)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * The `[table-cell]` Shortcode does not have a direct companion as a template tag
   function. You can however just embed it in a `do_shortcode()` call (which is 
   possible for every Shortcode:
 *     ```
       echo do_shortcode( '[table-cell id=123 row=1 column=1 /]' );
       ```
   
 * Regards,
    Tobias
 *  Thread Starter [millonario](https://wordpress.org/support/users/millonario/)
 * (@millonario)
 * [7 years ago](https://wordpress.org/support/topic/insert-table-with-php/#post-11548615)
 * Thank you very much, I wanted the PHP option, because I want to put another shortcode
   in to get a table number, do you know how I could do it? I want to do something
   similar to this:
 * [table-cell id=123 row=[id_user] column=1 /]
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [7 years ago](https://wordpress.org/support/topic/insert-table-with-php/#post-11548680)
 * Hi,
 * then just create the Shortcode (which is just a string) on the fly 🙂
 *     ```
       $user_id = ...;
       echo do_shortcode( "[table-cell id=123 row={$user_id} column=1 /]" );
       ```
   
 * Regards,
    Tobias
 *  Thread Starter [millonario](https://wordpress.org/support/users/millonario/)
 * (@millonario)
 * [7 years ago](https://wordpress.org/support/topic/insert-table-with-php/#post-11548691)
 * Thank you very much, I will try to do it!
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [7 years ago](https://wordpress.org/support/topic/insert-table-with-php/#post-11548988)
 * Hi,
 * no problem, you are very welcome! 🙂 Good to hear that this helped!
 * Best wishes,
    Tobias
 * P.S.: In case you haven’t, please [rate TablePress](https://wordpress.org/support/plugin/tablepress/reviews/)
   here in the plugin directory. Thanks!

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

The topic ‘insert table with php’ 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/)

 * 5 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [7 years ago](https://wordpress.org/support/topic/insert-table-with-php/#post-11548988)
 * Status: resolved