tableselect does not work for me somehow 1 Array
(
    [table] =&gt; Array
        (
            [#type] =&gt; tableselect
            [#header] =&gt; Array
                (
                    [field_name] =&gt; FIELD NAME
                    [field_type] =&gt; FIELD TYPE
                    [no_of_values] =&gt; NO OF VALUES
                    [display_fields] =&gt; DISPLAY FIELDS
                    [field_label] =&gt; FIELD LABEL
                    [required] =&gt; Required
                    [product_type] =&gt; Product Type
                )

            [#options] =&gt; Array
                (





            [field_colour_pro] =&gt; Array
                        (
                            [field_name] =&gt; field_colour_pro
                            [field_type] =&gt; 
                            [no_of_values] =&gt; 
                            [display_fields] =&gt; 1
                            [field_label] =&gt; color
                            [required] =&gt; 0
                            [product_type] =&gt; shirt
                        )

                    [field_description] =&gt; Array
                        (
                            [field_name] =&gt; field_description
                            [field_type] =&gt; 
                            [no_of_values] =&gt; 
                            [display_fields] =&gt; 1
                            [field_label] =&gt; description
                            [required] =&gt; 0
                            [product_type] =&gt; test_pro_v
                        )

                )

            [#multiple] =&gt; 1
        )




$header = array(
    'field_name' =&gt; t('FIELD NAME'),
    'field_type' =&gt; t('FIELD TYPE'),
    'no_of_values' =&gt; t('NO OF VALUES'),
    'display_fields' =&gt; t('DISPLAY FIELDS'),
    'field_label' =&gt; t('FIELD LABEL'),
    'required' =&gt; t('Required'),
    'product_type' =&gt; t('Product Type'),
  );

  $rows = array();
  foreach(commerce_product_types() as $product_type =&gt; $product_type_array){
    $field_info = field_info_instances('commerce_product',$product_type);
    foreach($field_info as $machine_name =&gt;$field_details){
      $rows[$machine_name] = array(
        'field_name' =&gt; $machine_name,
        'field_type' =&gt; $field_details['type'],
        'no_of_values' =&gt; $field_details['cardinality'],
        'display_fields'=&gt;1,
        'field_label' =&gt; $field_details['label'],
        'required' =&gt; $field_details['required'],
        'product_type'=&gt; $product_type,
      );

    }
  }

  $form['table'] = array(
    '#type' =&gt; 'tableselect',
    '#header' =&gt; $header,
    '#options' =&gt; $rows,
    '#multiple' =&gt; TRUE,
  );

//  print_r($form);
  $form['save'] = array(
    '#type' =&gt; 'submit',
    '#value' =&gt; t('Save'),
  );

return $form;




I tried to get the tableselect form #type into operation it does not work and gives empty row even when each row has values,I would like to help me find any silly mistake which I am making out here

Here is image of how the table select looks which is empty
I copied your code from and commented the variables and/or functions you're using since I don't know what they are for and just replaced a simple array to loop through.



/**
 * Implements hook_menu().
 */
function leomod_menu() {
  $items['leoo'] = array(
    'title' =&gt; 'asd',
    'page callback' =&gt; 'drupal_get_form',
    'page arguments' =&gt; array('leomod_asd_form'),
    'access callback' =&gt; TRUE,
  );
  return $items;
}

/**
 * Form.
 */
function leomod_asd_form($form, &amp;$form_state) {
  $header = array(
    'field_name' =&gt; t('FIELD NAME'),
    'field_type' =&gt; t('FIELD TYPE'),
    'no_of_values' =&gt; t('NO OF VALUES'),
    'display_fields' =&gt; t('DISPLAY FIELDS'),
    'field_label' =&gt; t('FIELD LABEL'),
    'required' =&gt; t('Required'),
    'product_type' =&gt; t('Product Type'),
  );

  $rows = array();
  $tests = array('1', '2', '3');
  //foreach(commerce_product_types() as $product_type =&gt; $product_type_array){
  foreach($tests as $test) {
    // $field_info = field_info_instances('commerce_product',$product_type);
    //foreach($field_info as $machine_name =&gt;$field_details){
      $rows[$test] = array(
        'field_name' =&gt; $test,
        'field_type' =&gt; $test,
        'no_of_values' =&gt; $test,
        'display_fields'=&gt; $test,
        'field_label' =&gt; $test,
        'required' =&gt; $test,
        'product_type'=&gt; $test,
      );
    //}
  }

  $form['table'] = array(
    '#type' =&gt; 'tableselect',
    '#header' =&gt; $header,
    '#options' =&gt; $rows,
    '#multiple' =&gt; TRUE,
  );

  //  print_r($form);
  $form['save'] = array(
    '#type' =&gt; 'submit',
    '#value' =&gt; t('Save'),
  );

  return $form;
}


Since your table structure is working, I suspect there is something wrong with these lines:

foreach(commerce_product_types() as $product_type =&gt; $product_type_array) {


and

$field_info = field_info_instances('commerce_product',$product_type);
foreach($field_info as $machine_name =&gt;$field_details) {


Also make sure you:


Flushed caches
Show all errors while developing since you're dealing with functions there that may return some errors that aren't displayed
Check the variables and functions if they return anything by using print_r() or Devel module's dsm().