Question

So I have wrote a simple table in my .admin.inc file :

<?php
  $form["myfieldset"]["mytable"] = array(
    '#type' => 'tableselect',
    '#header' => $headers,
    '#options' => $rows,
  );
?>

And I have all the data I want in it, but the first column of the table has checkboxes whereas I don't want any... Is it possible to remove them?

Thanks !

Was it helpful?

Solution

If you don't want the functionality provided by a tableselect element, the question has to be asked...why are you using a tableselect element?

It would make a lot more sense to use theme_table() if you just want a bog standard HTML table:

$form['myfieldset']['mytable'] = array(
  '#theme' => 'table',
  '#header' => $header,
  '#rows' => $rows
);

OTHER TIPS

Test this :

<?php
  $form["myfieldset"]["mytable"] = array(
    '#type' => 'tableselect',
    '#header' => $headers,
    '#options' => $rows,
    '#disabled' => TRUE
  );
?>

Have you try to add custom CSS like this :

.form-radios .form-disabled {
  display: none;
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top