正在载入...

文章目录
  1. Output Table HTML


Output Table HTML

$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>';
} 
Advanced Custom Fields: Table Field
  1. The Field Settings
  2. <p>The Field Content Editing</p>The Field Content Editing
  3. <p>Grab the rows and columns in the grey area and drag them.</p>

本文链接:

关键词:Fields, Table, WordPress, 互联网, 官方插件, 插件,

(全文完        )

Comments

哈哈,沙发有木有?!!!抢沙发快速评论