Back to school sale! Save up to 50%
Grab Yours

String column

Text is probably the most common data type when working with tables in WordPress. In this post we briefly explain how to work with text columns in wpDataTables.

String columns in wpDataTables

String column is the default, and the most basic column type of wpDataTables. You can put any content in a string column, and it will be rendered “as is”. If you, for example, want to put some specific HTML (buttons, iframes, or anything else) in a string column, you can generate it in the data source, and it will be rendered on the front-end.

  • Rendering rules: The only thing to note is that newline characters in the input data source will be translated to “<br/>” tag in the front-end.
  • Sorting rules: alphabetical.
  • Applicable filter types: text, selectbox, multi selectbox, checkbox.

Issues to note: if you use HTML inside of string columns, sorting and filtering by this column can in some cases yield strange results, since it will also apply the sorting rules to the HTML itself.

Example of a wpDataTable using string columns

First Name“, “Last Name” and “Position” columns of this table are string type columns:

Wait, Before You Download!

To get your hands on wpDataTables Lite, please enter your email address below. We’ll send you a direct download link and keep you updated on existing features along with helpful tips and tricks!

By continuing, I accept Privacy Policy and T&C
Mail Box