Welcome Guest, Not a member yet? Register   Sign In
How do I add an extra checkbox colum in a generated table? (JavaScript)
#1

How can I add an extra column to this with JS?

template = array(
        'table_open'            => '<table border="1" cellpadding="4" cellspacing="0">',

        'thead_open'            => '<thead>',
        'thead_close'           => '</thead>',

        'heading_row_start'     => '<tr>',
        'heading_row_end'       => '</tr>',
        'heading_cell_start'    => '<th>',
        'heading_cell_end'      => '</th>',

        'tbody_open'            => '<tbody>',
        'tbody_close'           => '</tbody>',

        'row_start'             => '<tr>',
        'row_end'               => '</tr>',
        'cell_start'            => '<td>',
        'cell_end'              => '</td>',

        'row_alt_start'         => '<tr>',
        'row_alt_end'           => '</tr>',
        'cell_alt_start'        => '<td>',
        'cell_alt_end'          => '</td>',

        'table_close'           => '</table>'
            );
    $this->table->set_template($template);
    return $this->table->generate($query1);
Reply
#2

SEE: The CodeIgniter HTML Table Class.

CodeIgniter User Guide - HTML Table Class

PHP Code:
$this->load->library('table');

$this->table->set_heading(array('Name''Color''Size'));

$this->table->add_row(array('Fred''Blue''Small'));
$this->table->add_row(array('Mary''Red''Large'));
$this->table->add_row(array('John''Green''Medium'));

echo 
$this->table->generate(); 

Using variables you could do it in a foreach loop.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB