Alright, I think I got it. Give this a try:
<table id="archives">
<?php $years = $wpdb->get_col("SELECT DISTINCT YEAR(post_date) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' ORDER BY post_date ASC");
foreach($years as $year) {
$months = $wpdb->get_col("SELECT DISTINCT MONTH(post_date) FROM $wpdb->posts WHERE YEAR(post_date) = $year AND post_status = 'publish' AND post_type = 'post' ORDER BY post_date ASC"); ?>
<tr>
<td><?php echo($year) ?></td>
<td>
<table>
<tr>
<?php foreach($months as $month) {
$month_text = date('M', mktime(0, 0, 0, $month, 1, $year)); ?>
<td><a href="#month"><?php echo($month_text) ?></a></td>
<?php } ?>
</tr>
<tr>
<?php foreach($months as $month) {
$posts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE YEAR(post_date) = $year AND MONTH(post_date) = $month AND post_status = 'publish' AND post_type = 'post' ORDER BY post_date ASC"); ?>
<td><a href="#month"><?php echo($posts) ?></a></td>
<?php } ?>
</tr>
</table>
</td>
</tr>
<?php } ?>
</table>
Let me know how that works out. Hopefully that does what you need. I think the code is pretty simple. You should be able to tell what it's doing I think...