Welcome Guest, Not a member yet? Register   Sign In
$this->table->set_heading() with row numbering?
#8

[eluser]Learn CodeIgniter[/eluser]
Code:
public function add_table_id()
{
    // Grab an array of users from the database
    $data = $this->your_model->your_function();

    // Setting headings for the table
    $this->table->set_heading('Row id', 'heading 2', 'heading 3', 'keep adding');

    $row_id = 1;

    foreach ($data as $value => $key)
    {
        // Adding row to table
        $this->table->add_row($row_id, $key['field1'], $key['field2'], $key['keep adding what you need']);
        $row_id++;
    }
}


Messages In This Thread
$this->table->set_heading() with row numbering? - by El Forum - 06-06-2012, 09:26 AM
$this->table->set_heading() with row numbering? - by El Forum - 06-07-2012, 04:22 AM
$this->table->set_heading() with row numbering? - by El Forum - 06-07-2012, 05:15 AM
$this->table->set_heading() with row numbering? - by El Forum - 06-07-2012, 05:53 AM
$this->table->set_heading() with row numbering? - by El Forum - 06-07-2012, 06:07 AM
$this->table->set_heading() with row numbering? - by El Forum - 06-07-2012, 06:09 AM
$this->table->set_heading() with row numbering? - by El Forum - 06-07-2012, 06:15 AM
$this->table->set_heading() with row numbering? - by El Forum - 06-07-2012, 12:17 PM
$this->table->set_heading() with row numbering? - by El Forum - 06-08-2012, 12:46 AM



Theme © iAndrew 2016 - Forum software by © MyBB