There are 2 ways of doing it.
First one is to define your own theme function using hook_theme and then either create a theme function of a template file inside of your module or theme folder.
example code is given here
/**
* Implements hook_theme().
*/
function MYMODULE_theme($existing, $type, $theme, $path) {
$custom_theme = array();
$custom_theme['my_new_theme'] = array(
// example theme template register
// for
//sites/all/modules/mymodule/templates/my_new_theme.tpl.php
'template' => 'my-new-theme',//dash will convert to underscore in template name.
'path' => drupal_get_path('module', 'mymodule') . '/templates',
'variables' => array('header' => null,'rows'=>null),
);
return $custom_theme;
}
You can then use
theme('my_new_theme', array('header' => $header, 'rows' => $rows));
instead of your theme function call.
And then inside of your my_new_theme.tpl.php you can access $header and $rows variables.
Second method is not recommended but a possible way of doing this.
So you can just create your HTML output in your callback function where you are creating that list. Store your full html to be out-puted in some variable and finally just return that variable at the end. Drupal will render your HTML as it is.
hook_theme
and implement it. But this question is rather broad because its not clear on what you are actually trying to achieve beyond that.