How to go about creating and formatting a custom HTML/PHP table to display SQL data I am new to drupal and basically I made a database within drupal and filled it with some dummy data. I want create/format/populate a table that looks like on one of my drupal pages:

+-----------+-------------------------+---------------------------+---------------+
| Resource  |          Week1          |          Week1+7          |    TOTALS     |
+-----------+-------------------------+---------------------------+---------------+
| resource1 | Hours(Week1, resource1) | Hours(Week1+7, resource1) | totals across |
| resource2 | Hours(Week1, resource1) | Hours(Week1+7, resource2) |               |
| TOTALS    | totals above            | totals above              |               |
+-----------+-------------------------+---------------------------+---------------+


I understand that you do it through views and I was trying to do it by creating my own module using the views_data() hook to try to create it (using http://mydons.com/how-to-expose-custom-module-table-to-views-in-drupal/ as a base/resource). I am kind of stuck though and I have no idea what the best approach would be to start to create a table that looks like the above. I am not sure this is the correct way/best way to do it and any direction/tips you guys can help me out with would be great.

Thanks!
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!