// Get all the rates and locations. Snagging all at once should significantly cut down on the number of queries.
$rates=$wpdb->get_results($wpdb->prepare("SELECT * FROM `{$wpdb->prefix}woocommerce_tax_rates` WHERE `tax_rate_class` = %s ORDER BY `tax_rate_order`;",sanitize_title($current_class)));
$locations=$wpdb->get_results("SELECT * FROM `{$wpdb->prefix}woocommerce_tax_rate_locations`");
<h3><?phpprintf(__('Tax Rates for the "%s" Class','woocommerce'),$current_class?esc_html($current_class):__('Standard','woocommerce'));?></h3>
<p><?phpprintf(__('Define tax rates for countries and states below. <a href="%s">See here</a> for available alpha-2 country codes.','woocommerce'),'http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes');?></p>
<thwidth="8%"><?php_e('Country Code','woocommerce');?> <span class="tips" data-tip="<?php esc_attr_e('A 2 digit country code, e.g. US. Leave blank to apply to all.', 'woocommerce'); ?>">[?]</span></th>
<thwidth="8%"><?php_e('State Code','woocommerce');?> <span class="tips" data-tip="<?php esc_attr_e('A 2 digit state code, e.g. AL. Leave blank to apply to all.', 'woocommerce'); ?>">[?]</span></th>
<th><?php_e('ZIP/Postcode','woocommerce');?> <span class="tips" data-tip="<?php esc_attr_e('Postcode for this rule. Semi-colon (;) separate multiple values. Leave blank to apply to all areas. Wildcards (*) can be used. Ranges for numeric postcodes (e.g. 12345-12350) will be expanded into individual postcodes.', 'woocommerce'); ?>">[?]</span></th>
<th><?php_e('City','woocommerce');?> <span class="tips" data-tip="<?php esc_attr_e('Cities for this rule. Semi-colon (;) separate multiple values. Leave blank to apply to all cities.', 'woocommerce'); ?>">[?]</span></th>
<thwidth="8%"><?php_e('Rate %','woocommerce');?> <span class="tips" data-tip="<?php esc_attr_e( 'Enter a tax rate (percentage) to 4 decimal places.', 'woocommerce' ); ?>">[?]</span></th>
<thwidth="8%"><?php_e('Tax Name','woocommerce');?> <span class="tips" data-tip="<?php esc_attr_e('Enter a name for this tax rate.', 'woocommerce'); ?>">[?]</span></th>
<thwidth="8%"><?php_e('Priority','woocommerce');?> <span class="tips" data-tip="<?php esc_attr_e('Choose a priority for this tax rate. Only 1 matching rate per priority will be used. To define multiple tax rates for a single area you need to specify a different priority per rate.', 'woocommerce'); ?>">[?]</span></th>
<thwidth="8%"><?php_e('Compound','woocommerce');?> <span class="tips" data-tip="<?php esc_attr_e('Choose whether or not this is a compound rate. Compound tax rates are applied on top of other tax rates.', 'woocommerce'); ?>">[?]</span></th>
<thwidth="8%"><?php_e('Shipping','woocommerce');?> <span class="tips" data-tip="<?php esc_attr_e('Choose whether or not this tax rate also gets applied to shipping.', 'woocommerce'); ?>">[?]</span></th>
'total'=>ceil(absint($wpdb->get_var($wpdb->prepare("SELECT COUNT(tax_rate_id) FROM {$wpdb->prefix}woocommerce_tax_rates WHERE tax_rate_class = %s;",sanitize_title($current_class))))/$limit)
<spanclass="displaying-num"><?phpprintf(_x('%s items','%s will be a number eventually, but must be a string for now.','woocommerce'),'{{ data.qty_rates }}');?></span>