Title: Table Headers and DataTable/Extenions&#8230;
Last modified: January 10, 2021

---

# Table Headers and DataTable/Extenions…

 *  Resolved [David](https://wordpress.org/support/users/dtcblyth/)
 * (@dtcblyth)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/table-headers-and-datatable-extenions/)
 * Hi Tobias,
 * I hope you are well. I’m currently writing some PHP functions for generating 
   TablePress tables via shortcodes and I have some general question regarding TablePress
   and table headers.
 * It’s seems as a general rule that in order to activate TablePress DataTable related
   features (and most of the TablePress Extensions) a table needs to have table 
   headers activated. Essentially, any TablePress shortcode that is prefixed with
   datatables_ requires that the table header is active. Is this true?
 * Also, it seems that the use_datatables shortcode doesn’t necessarily need to 
   be set to true for DataTables features to work. However, it can be set to false
   to de-activate all DataTable features at once. Is that also true?
 * I appreciate your time. 🙂
 * Kind regards,
    David.

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

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/table-headers-and-datatable-extenions/#post-13887659)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * First a remark: When using custom PHP code, it’s often better to not use the 
   Shortcode and have it parsed, but to directly call the Shortcode handler PHP 
   function (which also serve as “Template Tag functions”), see [https://tablepress.org/faq/documentation-template-tag-functions/](https://tablepress.org/faq/documentation-template-tag-functions/)
 * Regarding your questions:
 * Yes, the Table Header must always be present in the HTML code whenever using 
   DataTables or an Extension that is based on it. This is a requirement by DataTables.(
   Depending on the chosen features and Extensions, it’s often possible to leave
   the content of the header row cells empty and to hide it with CSS code, if it’s
   not desired.)
 * For `use_datatables`: I recommend to always set it to `true`, when DataTables
   is involved. For some Extensions, I have changed the code so that they internally
   set this to `true`, even if the user did not check the checkbox (to reduce friction
   for inexperienced users).
 * Regards,
    Tobias
 *  Thread Starter [David](https://wordpress.org/support/users/dtcblyth/)
 * (@dtcblyth)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/table-headers-and-datatable-extenions/#post-13887671)
 * Hi Tobias,
 * Thanks for your quick and clear response, as usual!
 * Actually, I am using the Template Tag functions, I just said shortcodes as I 
   thought it was perhaps the easiest way of clarifying my question… I don’t know
   why. 🙂 Thanks for the advice though!
 * Thanks for the explanation on the `use_datatables` property… I’ll keep that in
   mind too.
 * All the best,
    David.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/table-headers-and-datatable-extenions/#post-13887726)
 * 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/#new-post)
   here in the plugin directory. Thanks!

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

 The topic ‘Table Headers and DataTable/Extenions…’ 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/)

 * 3 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [5 years, 9 months ago](https://wordpress.org/support/topic/table-headers-and-datatable-extenions/#post-13887726)
 * Status: resolved