Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Johann Heyne

    (@jonua)

    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 7 years, 9 months ago by Johann Heyne. Reason: Fix typo
    Thread Starter myasinveici

    (@myasinveici)

    Where I upload the code in WordPress?

    Thread Starter myasinveici

    (@myasinveici)

    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 7 years, 9 months ago by myasinveici.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Array’ is closed to new replies.