Part of the problem is that you’re running (or re-running) get_header()
after your table, thus putting all of the header content into the body of page after the table HTML has started.
<?php
/*
Template Name: Custom Table
Is this part even needed for you? If this is a complete template,
then probably, but if it is just a template part, then you're
reproducing something that has already run elsewhere. You need
to know more about your template/template-part structure.
*/
get_header();
?>
<table id = "inner-wrap" class="empTable" border="1">
<tr>
<th>Name</th>
<th>ID</th>
<th>Active</th>
</tr>
<?php
global $wpdb;
$result = $wpdb->get_results ( "SELECT * FROM DBTable" );
foreach ( $result as $print ) {
echo '<tr>';
echo '<td>', $print->name,'</td>';
echo '<td>', $print->id,'</td>';
if($print->active == 1){
echo '<td>', 'Active','</td>';
}else{
echo '<td>', 'Inactive','</td>';
}
echo '</tr>';
}echo '</table>';
get_footer();