PHP – Loop custom post type categories within jQuery Tabs

You can fire query only by 'meta_key'=> 'selsubcat' without meta_value `and you will get all subcategories. Then you should loop outside you tab with some increment(maybe a name of category or numeric id) something like this:

<?php 
foreach( $posts as $post ): setup_postdata( $post ); ?>
    <div id="tabs-<?php the_ID(); ?>">   
        <table id="table-<?php the_ID(); ?>" class="display" cellspacing="0" width="100%">
          <tbody>
                <tr>
                    <td class="hidden"><?php the_ID(); ?></td>
                    <td><span class="product-image" style="background:url(<?php the_field('image'); ?>);"></span></td>
                    <td><?php the_field('code'); ?></td>
                    <td><?php the_field('description'); ?></td>
                    <td><?php the_field('cost_price'); ?></td>
                    <td><input type="text" /></td>
                    <td><input type="text" /></td>
                    <td><input type="button" class="add-row" name="add-row" value="Add"></td>
                </tr>
          </tbody>
            <?php $product_increment++; endforeach; ?>
        </table>    
      </div>
</div>