[eluser]e.abubakr89[/eluser]
Hello all
I have found my solution
:lol: :lol: :lol:
by do not passing the $records directly to table.generate() function
but firstly I have to use table.add_row() function and set what I need
for example
I set my controller as
Code:
function outbox()
{
$this->load->library('table');
$this->load->library('pagination');
$config['base_url'] = 'http://localhost/we_hona/index.php/private_messages/outbox';
$this->db->where('from',$this->input->post('session_username'));
$config['total_rows'] = $this->db->get('pm')->num_rows();
$config['per_page'] = 3;
$config['num_links'] = 5;
$config['full_tag_open'] = '<div id="outbox_pages">';
$config['full_tag_close'] = '</div>';
$this->pagination->initialize($config);
$this->db->where('from',$this->input->post('session_username'));
$records = $this->db->get('pm', $config['per_page'], $this->uri->segment(3));
foreach ($records->result() as $item)
{
$q[] = $item;
}
$data['records'] = $q;
$this->load->view('outbox_2',$data);
}
then go to outbox_2 view and using foreach to execute $records record by record to pass it to table by table.add_row , and I can specify how
message td will display
Code:
<?php
foreach ($records as $item)
{
$this->table->add_row(array($item->from,$item->to,$item->title,"<a >id."' >".substr($item->message,0,8)." </a>"));
}
echo $this->table->generate();
?>
I dont know why code editor remove the href of my code
===========================
thanks for all who helped me
goodbye