• Resolved mrernie

    (@mrernie)


    Hi,

    is it possible add header title to all td?

    echo ‘<tr>’;
    foreach ( $tr as $td ) {
    echo ‘<td>’;
    echo ‘<label>(TABLE HEADER TITLE)</label>’;
    echo $td[‘c’];
    echo ‘</td>’;
    }
    echo ‘</tr>’;

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

    (@jonua)

    Just use the $table[‘header’] array again…

    echo '<tr>';
        foreach ( $table['header'] as $th ) {
            echo '<td>';
                echo '<label>' . $th['c'] . '</label>';
            echo '</td>';
        }
    echo '</tr>';

    or get the header value by $key…

    echo '<tr>';
        foreach ( $tr as $key => $td ) {
            echo '<td>';
                echo '<label>' . $table['header'][ $key ]['c'] . '</label>';
                echo $td['c'];
            echo '</td>';
        }
    echo '</tr>';

    Cheers,
    Johann

Viewing 1 replies (of 1 total)
  • The topic ‘Header title to TD’ is closed to new replies.