Im using Drupal 6.x. In my page i have the following code which prints a paged table.
$headers = array(array('data' => t('Node ID'),'field' => 'nid','sort'=>'asc' ),
array('data' => t('Title'),'field' => 'title'),
);
print theme('pager_table','SELECT nid,title FROM {node_revisions}', 5, $headers );
Is there a way i can pass the rows of a table as an array to the theme function ?
I don’t know
theme_pager_table, it’s not a part of Drupal core. What you can do, it to wrap your sql inpager_query(), then you can loop through your results and create the table rows like normal.pager_query()will handle adding theLIMITandOFFSETin the query.Doing this you cam use the normal
theme_tableand just add the pager withtheme_pager. (Remember to use thetheme, wrapper function instead of calling the theme functions directly)