How to go about creating and formatting a custom HTML/PHP table to display SQL data
You can create a custom table to display whatever data you want in a custom module by building the information output in a function, first you have to implement HOOK_menu for defining you path for the page containing the table and afterwards implementing the callback function for that page. I'll give you a real example here:

/**
* Implement hook_menu().
*/
function HOOK_menu() {
  $items = array();

$items['admin/config/my_table'] = array(
      'title' =&gt; 'My Table Page',
      'description' =&gt; '',
      'page callback' =&gt; 'my_table',
      'access arguments' =&gt; ....,
    );

 return $items; 
}


As you can see i have my path and the callback is defined to the function my_table. Let's create that as well

function my_table {

    // Create table header 
    $header = array(
        array('data' =&gt; t('COLUMN 1')),
        array('data' =&gt; t('ANOTHER ONE')),
        array('data' =&gt; t('COLUMN EXAMPLE')),
        array('data' =&gt; t('BLA BLA'))
    );

   .... // create table rows

    $output = '&lt;div class="description"&gt;';
    $output .= '&lt;p&gt;' . t('Say whatever you want to appear'). '&lt;/p&gt;';
    $output .= '&lt;/div&gt;';


    // here we render the actual table
    $output .= theme('table', array('header' =&gt; $header, 'rows'=&gt; $rows, 'attributes' =&gt; array('id' =&gt; 'something') ));

    // and return the html output to our page
    return $output;


}


Hope this helps! Cheers!