[eluser]4ever[/eluser]
Hi, I just try the pagination library. I did a table with hundreds of records and now trying to print them. This is my config:
Code:
function index(){
$this->load->library('pagination');
$config['base_url'] = "http://localhost/ci/page/index";
$config['total_rows'] = $this->db->get('messages')->num_rows();
$limit = $config['per_page'] = 10;
$config['num_links'] = 14;
$offset = $this->uri->segment(3);
$this->pagination->initialize($config);
$data['records'] = $this->db->get('messages',$limit,$offset); // row limit from db
$this->load->view('messages_view',$data);
}
And I got this out put:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 > Last ›
But when I click on 11 then I got this output:
< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 > Last ›
Which is much more wider than the basic 15 links.
So I want to ask is this normal or is possible to set the pagination to not to be wider then the original list of links. That means I would like to see something like this:
< 8 9 10 11 12 13 14 15 16 17 18 > Last
When I click on then or maybe be it like so:
< 10 11 12 13 14 15 16 17 18 19 20> Last
I want just to say that is looks weird such behaviour
But next problem is
That when the number has more digits so it gets longer:
‹ First < 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 > Last ›
So this looks like it would to be good to make some change to the library to be it able to count with the numbers how many digits they have.
Guys,
do you have some idea how to compute this: how many digits does the number have?