Welcome Guest, Not a member yet? Register   Sign In
Display an incrementing number in each row when using table class
#2

[eluser]flaky[/eluser]
when you are building the array for the table, just add the extra column with the number
Code:
$this->load->library('table');

$data = array(
             array(1, 'Name', 'Color', 'Size'),
             array(2, 'Fred', 'Blue', 'Small'),
             array(3, 'Mary', 'Red', 'Large'),
             array(4, 'John', 'Green', 'Medium')
             );

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


Messages In This Thread
Display an incrementing number in each row when using table class - by El Forum - 01-07-2010, 02:20 AM



Theme © iAndrew 2016 - Forum software by © MyBB