Welcome Guest, Not a member yet? Register   Sign In
Pagination with anchor tags
#1

[eluser]nikhil_22[/eluser]
Hi i am pulling out data from the database using pagination..and then loading it into a table..but i want the data in my table to be links ...is this possible ???please help


thanks
Nikhil
#2

[eluser]Rob Gordijn[/eluser]
how do you load the data into the table?

some code please Smile

(reminds me of someone's sig, something with W.W.W )
#3

[eluser]nikhil_22[/eluser]
This is my function

function start_post(){

$this->load->library('pagination');
$this->load->library('table');
$this->table->set_heading('Category name','Category Description');
$config['base_url']='http://mysite/index.php/forum/start_post';
$config['total_rows']=$this->db->get('categories')->num_rows();//total no of rows from data table
$config['per_page'] =7; //how many per page
$config['num_links']=20;//no of links
$config['full_tag_open']= '<div id="pagination"> ' ;
$config['full_tag_close']='</div>' ;
$this->pagination->initialize($config);
//pass the config items to initialize

$data['records']=$this->db->get('categories',$config['per_page'],$this->uri->segment(3));
//second argument is the limit per page.The third argument is the offset//

$this->load->view('new_post_form',$data);

}
And this code is my view

&lt;?php echo $this->table->generate($records) ?&gt;
&lt;?php echo $this->pagination->create_links();?&gt;
I want to include anchor tags inside my table data so that each data entry in the table is a link.
#4

[eluser]Rob Gordijn[/eluser]
well, my guess (shoot me not if I'm wrong) is that you need to modify the data in $data['records'].
at this moment it clearly has plain data inside, you can loop through the data and add some html Smile




Theme © iAndrew 2016 - Forum software by © MyBB