WordPress.org

Plugin Directory

Test out the new Plugin Directory and let us know what you think.

Advanced Custom Fields: Table Field

A Table Field Add-on for the Advanced Custom Fields Plugin

The Table field plugin enables easely editing a table.
The plugin ist compatible with ACF4 and ACF5.
The table field works also with the repeater and flexible field types.

  • table header (option)
  • add and remove table columns and rows
  • change order of columns and rows by dragging

To display the table fields data as an html table you can start with the following code.

$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>';
}
Tags:

Requires: 4.5.3 or higher
Compatible up to: 4.6.2
Last Updated: 5 months ago
Active Installs: 8,000+

Ratings

5 out of 5 stars

Support

0 of 2 support threads in the last two months have been marked resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1
100,1,1 0,1,0 100,1,1
0,1,0 100,1,1
100,2,2
100,1,1
100,1,1
100,2,2
100,1,1