Hi,
I’m not sure what you trying to do.
If you want to predefine a table when creating a new Custom Posts entry. Then you would have to create the data of a table in the database as post meta for the corresponding table field. To get the table data, you could create and save the table as desired in that custom post, copy the code from the post meta of that table field from the database and use it for your script to create a predefined table.
Or if you want the give a default table, if a table is empty…
$table = get_field( 'your_table_field_name' );
if ( empty ( $table ) ) {
// defining the data of the default table
$table = array(
'header' => array(
'c' => 'Column 1',
),
'body' => array(
array( // a column
array( // a cell of the column
'c' => 'Cell Value of Column 1', // the value of the cell
),
),
),
);
// output code follows…
echo '<table border="0">';
// and so on
}
Cheers,
Johann