How to hide row cell when using table in forms?
I've just implemented it using a theme preprocessor to alter the tag from &lt;td&gt; to &lt;span&gt; and I've added the hidden and aria-hidden attributes. Hidden by itself works but it isn't supported by &lt; IE10.

So as to prevent the loops on every table I've added a class to the table as well so I'm checking for 'form-table' first.

/* Implements MODULE_preprocess_HOOK */
function mymodule_preprocess_table(&amp;$variables) {
  if ( ! in_array('form-table', $variables['attributes']['class']) )
    return;

  // Iterate the variables looking for form elements that have the type hidden
  foreach ($variables['rows'] as $key =&gt; &amp;$row ) {
    foreach ( $row['cells'] as &amp;$cell ) {
      if ( $cell['content']['#type'] == 'hidden' ) {
        $cell['attributes']['hidden'] = TRUE;
        $cell['attributes']['aria-hidden'] = 'true';
        $cell['tag'] = 'span';
      }
    }
  }
}