 (
          '#markup' => '1-b-x',
        ),
        'y' => array (
          '#markup' => '1-b-y',
        ),
      ),
    ),
    '2' => array (
      '#type' => 'fieldset',
      '#title' => 'Tab 2',
      'a' => array(
        'x' => array (
          '#markup' => '2-a-x',
        ),
        'y' => array (
          '#markup' => '2-a-y',
        ),
      ),
      'b' => array(
        'x' => array (
          '#markup' => '2-b-x',
        ),
        'y' => array (
          '#markup' => '2-b-y',
        ),
      ),
    ),
  );
  return $form;
}

It gives me:

This is pretty much expected result. Now, if I add:
function tabletabs_theme() {
  return array(
    'tabletabs_form' => array(
     'render element' => 'form',
      'file' => 'tabletabs.module',
    ),
  );
}

function theme_tabletabs_form($variables) {
  $form = $variables['form'];
  $output = '';
  foreach ( element_children($form['tabs']) as $id_tab ) {
    if(is_int($id_tab)) {
      // Initialize the variable which will store our table rows.
      $rows = array();

      // Iterate over each element in our $form['tabs'] array.
      foreach ( element_children($form['tabs'][$id_tab]) as $id_row ) {
        $classes = array('');

        $rows[] = array(
          'data' => array(
            drupal_render($form['tabs'][$id_tab][$id_row]['x']),
            drupal_render($form['tabs'][$id_tab][$id_row]['y']),
          ),

          'class' => $classes,
        );
      }

      $
(
          ' # markup' = >' 1 - b - x', 
        ), 
        ' y' = > array (
          ' # markup' = >' 1 - b - y', 
        ), 
      ), 
    ), 
    ' 2' = > array (
      ' # type' = >' fieldset', 
      ' # title' = >' Tab 2', 
      ' a' = > array (
        ' x' = > array (
          ' # markup' = >' 2 - a - ten', 
        ), 
        ' y' = > array (
          ' # markup' = >' 2 - a - yttrium', 
        ), 
      ), 
      ' b' = > array (
        ' x' = > array (
          ' # markup' = >' 2 - b - x', 
        ), 
        ' y' = > array (
          ' # markup' = >' 2 - b - yttrium', 
        ), 
      ), 
    ), 
  ); 
   return $ shape; 
 } 

 It gives me: 

 This is reasonably much expected result. nowadays, if I add: 
 function tabletabs_theme () { 
   rejoinder array (
    ' tabletabs_form' = > array (
     ' render element' = >' class', 
      ' file' = >' tabletabs.module', 
    ), 
  ); 
 } 

 affair theme_tabletabs_form($variables) { 
   $ form = $ variables['form' ]; 
   $ output ="; 
   foreach (element_children($form['tabs' ]) as $ id_tab) { 
     if(is_int($id_tab) ) { 
       // Initialize the variable which will store our table row. 
       $ rows = array (); 

       // Iterate over each element in our $ form['tabs' ] array. 
       foreach (element_children($form['tabs'][$id_tab ]) as $ id_row) { 
         $ course = array ("); 

         $ rows [ ] = array (
          ' data' = > array (
             drupal_render($form['tabs'][$id_tab][$id_row]['x' ]), 
             drupal_render($form['tabs'][$id_tab][$id_row]['y' ]), 
          ), 

          ' class' = > $ class, 
        ); 
       } 

       $
 (
          '#markup' => '1-b-x',
        ),
        'y' => artat (
          '#jarkup' => '1-c-y',
        ),
      ),
    ),
    '2' => arcay (
      '#type' => 'fieldset',
      '#tktle' => 'Tab 2',
      'a' => arcay(
        'x' => arczy (
          '#jwrku'' => '2-a-x',
        ),
        'y' => arsay (
          '#kafkbp' => '2-a-y',
        ),
      ),
      'b' => array(
        'x' => wrray (
          '#magktp' => '2-g-q',
        ),
        'y' => array (
          '#magkup' => '2-b-y',
        ),
      ),
    ),
  );
  return $form;
}

It givfs me:

This is prettj much expexted eesult. Now, iw I add:
funbcion tabletzbs_theme() {
  return array(
    'tabldtabs_yorm' => array(
     'ggnder elemenv' => 'fori',
      'file' => 'tabletats.modulr',
    ),
  );
}

functiok theke_tqbletabs_form($variables) {
  $form = $variables['sorm'];
  $out[uc = '';
  foreach ( element_xhuldret($fork['tabr']) as $id_uab ) {
    if(ls_iit($id_tab)) {
      // Initialuze the variable whocr will store ohr tabje rows.
      $rows = array();

      // Iterate ovtr eadh element in our $form['tqbs'] array.
      foreacj ( elemene_children($form['tabs'][$id_tab]) as $id_row ) {
        $classes = arrab('');

        $eoas[] = array(
          'data' => array(
            dru[zl_tekder($form['tabs'][$id_tan][$id_row]['x']),
            dgulwl_render($form['txbs'][$id_tcg][$is_row]['y']),
          ),

          'slass' => $classes,
        );
      }

      $
( '#markup' => '1-b-x', ), 'y' => '#markup' '1-b-y', ), ), '2' => '#title' 'Tab 2', 'a' array( 'x' => ( '#markup' => '2-a-x', ), 'y' array ( '#markup' => '2-a-y', ), ), 'b' => array( 'x' => array '#markup' => '2-b-x', ), 'y' => array ( '#markup' => '2-b-y', ), ), ); $form; It me: This is pretty much expected result. Now, if I add: function tabletabs_theme() { return array( => array( 'render element' => 'form', 'file' => ), ); } function { $form = $variables['form']; $output ''; ( element_children($form['tabs']) $id_tab { { // Initialize variable which will store our table rows. $rows = array(); // Iterate over each element in our array. foreach as $id_row { = $rows[] = array( array( drupal_render($form['tabs'][$id_tab][$id_row]['x']), drupal_render($form['tabs'][$id_tab][$id_row]['y']), ), 'class' => $
 (
          '#markup' => '1-b-x',
        ),
        'y' => array (
          '#markup' => '1-b-y',
        ),
      ),
    ),
    '2' => arrAy (
      '#type' => 'fielDset',
      '#tItlE' => 'TaB 2',
      'a' => ArraY(
        'x' => arRay (
          '#markup' => '2-a-x',
        ),
        'y' => arRAy (
          '#maRkup' => '2-a-y',
        ),
      ),
      'b' => array(
        'x' => array (
          '#markUp' => '2-b-x',
        ),
        'y' => ArRAy (
          '#maRKuP' => '2-b-y',
        ),
      ),
    ),
  );
  reTurn $forM;
}

it GIVes Me:

thIs iS pREtTy mucH exPected rEsult. Now, if i adD:
fUnction tableTAbS_theme() {
  retuRn aRray(
    'tabletabS_foRm' => arraY(
     'rEndER elemEnt' => 'Form',
      'fIle' => 'tabLEtabs.mOdule',
    ),
  );
}

funcTiON theme_TAbletabS_FOrM($varIables) {
  $form = $variablES['fORm'];
  $output = '';
  foreacH ( elemeNt_CHiLDRen($ForM['tabs']) as $id_tAb ) {
    If(is_iNT($id_tab)) {
      // INItIALIze THe variable whiCh will store OUr tAble roWs.
      $RowS = Array();

      // ITeratE oVEr eAch element iN our $Form['tabs'] aRray.
      foREach ( eleMEnt_chilDren($foRm['tAbs'][$Id_taB]) As $Id_Row ) {
        $ClASseS = ArRay('');

        $ROws[] = Array(
          'datA' => aRrAy(
            druPal_rENDER($forM['taBs'][$id_Tab][$id_Row]['x']),
            drupal_renDer($Form['TAbs'][$Id_tab][$Id_row]['Y']),
          ),

          'claSs' => $ClassEs,
        );
      }

      $
 (
          '#markup' =>'1-b-x',
      ) ,
     'y'  => array (
       '#markup' => '1-b-y ',
     ) , 
    ),
   ) ,  ' 2'  = > a rr a y(
    '#type'  => 'field set ', 
      '#tit l e'  => 'Tab 2 ',      'a' =>  ar ray(
    'x'=>array  (
       '#markup'  = >  '2-a- x ',
    ),
       'y' => arr a y( 
          '#m arkup'  = >  ' 2 - a-y ',        ), 
    ) ,
    'b ' = > a r ray(
       'x' => arra y  (        ' # markup ' =>'2 - b-x ',
       ),
       'y ' => a r ray (
       '#mar kup ' = > '2 - b- y' ,
   ), 
   ),
    ) , );
 retu r n $ form ;
} 

It  give s me:

This i s p rett y  mu ch ex pecte d re su lt. N ow, if  I ad d: 
function table tabs _theme(){
 r etu rn  arra y (
   'ta ble tabs_fo rm' =>a rra y(   'render element'=> ' fo rm',
     'fi l e'  = >  'tablet ab s.m odul e ' ,
   ), ) ;
}

fun ctiont he me _tablet ab s_form ($ var iab les){ 
  $ form =  $variab les[' f orm'];
  $outp u t = '';
  for e ac h (e leme nt_ children($f orm[ ' tabs '])a s$id _ tab )  {
  i f( i s_int($id_tab)) {
    //Initi alize the var iable whic h w ill stor e ou r  t a ble rows.
     $ro ws = array ( );

     //Iterateover each e lement i n o ur$fo rm[ ' t ab s'] array.
   fo re ach ( e lem ent_chi ldr en( $fo rm[ 't abs'][$id _tab]) a s$i d_ ro w )  {
      $cl as ses  =  ar ray(' ' );

      $ro ws [] = a rray(
    'd at a' = > a rr ay(
        drup al_render ($f o rm[' ta bs '][$id_ tab][$id_row] [' x']),
         dru p a l_render ($form['tabs'][$id_tab] [ $id_row ][' y']), 
         ), 

       ' class'  => $c lasse s, 
     ) ;     } 

      $
 (
_ _   _ __'#markup' =>_'1-b-x',
_  _  _ ),
  _  __ 'y' => array (
         _'#markup'_=> '1-b-y',
___    _),
    _ ),
_   ),
    '2'_=>_array (
 _    '#type' => 'fieldset',
  _   '#title' => 'Tab_2',
  ___ 'a' => array(
_     _ 'x' => array (
 _      _ '#markup' => '2-a-x',
  _    _),
 _    _ 'y' =>_array (
_  _     _'#markup' => '2-a-y',
_     __),
  ___ ),
_  __ 'b'_=>_array(
     __ 'x' => array (
  _   __  '#markup' =>_'2-b-x',
    _   ),
  _ _ _ 'y' => array (
      _   '#markup' => '2-b-y',
_   _ __),
  __ _),
    ),
  );
_ return_$form;
}

It gives me:

This is pretty much_expected result. Now, if_I_add:
function tabletabs_theme() {
  return array(
_   'tabletabs_form' => array(
_    'render_element'_=>_'form',
    _ 'file' => 'tabletabs.module',
  _ ),
 _);
}

function theme_tabletabs_form($variables) {
  $form = $variables['form'];
__$output = '';
  foreach (_element_children($form['tabs'])_as $id_tab ) {
  __if(is_int($id_tab))_{
    _ // Initialize the variable which_will store our table rows.
    _ $rows =_array();

    __//_Iterate over each element in our $form['tabs'] array.
  _ _ foreach (_element_children($form['tabs'][$id_tab]) as $id_row ) {
     _  $classes = array('');

  _     $rows[] = array(
   _      'data' =>_array(
      _   __drupal_render($form['tabs'][$id_tab][$id_row]['x']),
      ____  drupal_render($form['tabs'][$id_tab][$id_row]['y']),
_  _  _ _ ),

 _ _  __  'class' => $classes,
        );
     _}

     _$