Are you making a plugin Tom ? Paste your plugin's code here. I'll edit it for you.
It's only a tiny page ATM
I basically need to echo some HTML to make a table in the style of the theme the user is using

You can make it as a template and then evaluate it in the plugin function.
I want to try and do it without templates, but I guess I could use them.
How do you define and fill and call a template?
Could you just paste it
At college and your site is blocked

OK, Make a template with this code;
require MYBB_ROOT."/inc/adminfunctions_templates.php";
$template = array(
"title" => "TEMPLATE_NAME",
"template" => 'TEMPLATE_CODE',
"sid" => -1
);
$db->insert_query("templates", $template);
Now use this following code to evaluate this template;
eval("\$VARIABLE = \"".$templates->get("TEMPLATE_NAME")."\";");
And finally, use this variable: $VARIABLE and place it in the template where you want the template code to show.
Can I just create a template and call it? I dont really understand eval :;
No, you've to evaluate it for displaying whats inside it.