A table field returns an array that contains the table data. To render the array into an html table, please start with the code provided here.
-
This reply was modified 9 years, 3 months ago by
Johann Heyne. Reason: Fix typo
Where I upload the code in WordPress?
The following code where do I upload to display table.
In the show table with face moving Array error
The following sample error page
https://goo.gl/vL8ocL
Please check the help
$table = get_field( ‘your_table_field_name’ );
if ( $table ) {
echo ‘<table border=”0″>’;
if ( $table[‘header’] ) {
echo ‘<thead>’;
echo ‘<tr>’;
foreach ( $table[‘header’] as $th ) {
echo ‘<th>’;
echo $th[‘c’];
echo ‘</th>’;
}
echo ‘</tr>’;
echo ‘</thead>’;
}
echo ‘<tbody>’;
foreach ( $table[‘body’] as $tr ) {
echo ‘<tr>’;
foreach ( $tr as $td ) {
echo ‘<td>’;
echo $td[‘c’];
echo ‘</td>’;
}
echo ‘</tr>’;
}
echo ‘</tbody>’;
echo ‘</table>’;
}
-
This reply was modified 9 years, 3 months ago by
myasinveici.