ACF Table Field Pro Add-on Docs Last updated:

Select plugin version:

Since version: v1.6.0

Field data

New since version 1.6.0

New table option:

  • eb Disables table output when all body cells are empty.
  • eh Disables table output when all header cells are empty.
  • ef Disables table output when all footer cells are empty.
  • esb Disables table output when all body stub-cells are empty.
  • esh Disables table output when header stub-cell is empty.
  • esf Disables table output when footer stub-cell is empty.

Please understand

You better not rely on the raw database table data structure as it may change in the future. There will be a table manager table_manager() to get, change and update table data.

The data of a table field is stored in the WordPress database as a serialized array. Depending on where the table data is processed, it is either a PHP array, a JavaScript object, or a JSON string. There is also a formatted and unformatted version of the data depending on the $format_value parameter used in get_field() and get_sub_field().

Example table

Here is an example of a simple table and the raw data stored in the database expressed as JSON.

A B
1 some
2 thing

The example table data as JSON

{ 
	"t":{ // stores table meta data 
		"o":{ // the table options 
			"ca":"", // caption 
			"pc":"n", // preview caption 
			"ct":"ed", // content type 
			"tb":"basic", // toolbar for wysiwyg editor 
			"uh":"y", // use header 
			"uf":"n", // use footer 
			"sc":"n", // use stub column 
			"st":"", // styles 
			"cols": 2, // amount of columns 
			"rows": 3, // amount of rows 
			"changed": true, // default table was changed 
			"eb": "y", // disables table output when all body cells are empty 
			"eh": "y", // disables table output when all header cells are empty 
			"ef": "y" // disables table output when all footer cells are empty 
			"esb": "y", // disables table output when all body stub-cells are empty 
			"esh": "y", // disables table output when header stub-cells is empty 
			"esf": "y", // disables table output when footer stub-cells is empty 
		} 
	}, 
	"c":[ // table columns 
		{ // the columns row 
			"c": [ // column entries 
				{ // a column 
					"o":{} // options a this column 
				}, 
				{ 
					"o":{} 
				} 
			] 
		}, 
	], 
	"h":[ // table header 
		{ // the header row 
			"c": [ // header cells 
				{ // a header cell 
					"c":"A",  // a header cell content 
					"o":{}  // a header cell options 
				}, 
				{ 
					"c":"B", 
					"o": {} 
				} 
			], 
			"o":{} // the header row options 
		}, 
	], 
	"b":[ // table body 
		{ // a table body row 
			"c": [ // a body row cells 
				{ 
					"c":"1", // a body cell content 
					"o":{} // a body cell options 
				}, 
				{ 
					"c":"some", 
					"o":{} 
				} 
			], 
			"o":{} // a body row options 
		}, 
		{ 
			"c": [ 
				{ 
					"c":"2", 
					"o":{} 
				}, 
				{ 
					"c":"thing", 
					"o":{} 
				} 
			], 
			"o":{} 
		} 
	], 
	"p":[ // general parameters 
		"v": "1.0.0", // the plugin version used to save the data 
		"fk": "field_664dcdcdd4983", // field key 
		"fn": "table" // field name 
	], 
}

Depending on where the table field data is processed, it is a PHP array, a Javascript object or a JSON string.

Table object

Table options structure

{ 
	"t":{ 
		"o":{ 
			"ca":"", // caption 
			"pc":"n", // preview caption 
			"ct":"ed", // content type 
			"tb":"basic", // toolbar for wysiwyg editor 
			"uh":"y", // use header 
			"uf":"n", // use footer 
			"sc":"n", // use stub column 
			"st":"", // styles 
			"cols": 2, // amount of columns 
			"rows": 3, // amount of rows 
			"changed": true, // default table was changed 
			"eb": "y", // disables table output when all body cells are empty 
			"eh": "y", // disables table output when all header cells are empty 
			"ef": "y" // disables table output when all footer cells are empty 
			"esb": "y", // disables table output when all body stub-cells are empty 
			"esh": "y", // disables table output when header stub-cells is empty 
			"esf": "y", // disables table output when footer stub-cells is empty 
		} 
	} 
}

The object "t" stands for parameters of this table. This parameter object has an object "o" which stands for options.

Why are the keys in the table data usually only one or two digits long?

Originally, the idea was to ensure that global searches within the table data returned results based solely on the actual content strings rather than on internal keys. Since most search functions only activate after three characters, this distinction mattered for accuracy and relevance.

Table options list

Name Decription Type Value Module
ca Table caption string caption
pc Preview of table caption string y/n caption
changed Whether the table content was edited boolean false/true main
uh Use header string y/n thead
uf Use footer string y/n tfoot
cols Amount of the table body colums integer cols_rows_limit
rows Amount of the table body rows integer cols_rows_limit
ct Content type of cells string st/ed cell_content_type
tb Toolbar for wysiwyg editor string full/basic editor
st Style string table_styles
sc Stub Column string y/n stub_column
eb Disables table output when all body cells are empty string y output
eh Disables table output when all header cells are empty string y output
ef Disables table output when all footer cells are empty string y output
esb Disables table output when all body stub-cells are empty string y output
esh Disables table output when header stub-cell is empty string y output
esf Disables table output when footer stub-cell is empty string y output

Previous and Next Sources

Parent sources