Show a Particular Page in Drupal 7 Table Pager I have a table and a table pager in my form.

// $table_rows is an array containing data.
$page = 2; 
//$page indicates that I want to display the second page in the table pager 
//$page is dynamic. It depends on the user.
$per_page = 5; //No. of items per page    
$chunks = array_chunk($table_rows, $per_page, TRUE); // Split an array into chunks of $per_page

$html =  theme('table', array('header' =&gt; $header, 'rows' =&gt; $chunks[$page], 'sticky' =&gt; TRUE)) . theme("pager", array('quantity',count($table_rows))); 


The result of my code is below:



It works fine as expected , but my pager number is not. It must  show 2 as the current page. Where am I missing?
I think theme_pager in your case never know about current page, by which it can decide where to add 'page-current' class.

Try passing 'element' parameter the way you are doing for quantity.

$html =  theme('table', array('header' =&gt; $header, 'rows' =&gt; $chunks[$page], 'sticky' =&gt; TRUE)) . theme("pager", array('element'=&gt; $page, 'quantity',count($table_rows)));


While $page will be less than a value of actual current page value. Please see theme_pager to see how it works.