[prev in list] [next in list] [prev in thread] [next in thread] 

List:       drupal-development
Subject:    [development] form elements will be easy to put into a table
From:       barry () jaspan ! org (Barry Jaspan)
Date:       2007-04-27 13:25:39
Message-ID: u7iry6jak.fsf () jaspan ! org
[Download RAW message or body]


> I have done some work on this and added it to my sandbox. So please
> give me some feedback.

I think this resolves an annoyance I've had with theme('table') for a
while: the theme function cannot assume the table is in "normal form"
(every element uses a 'data' attribute).  If I want to theme the first
column of the first row differently, I'd like to write something like:

function mytheme_table($hdrs, $rows) {
  $rows[0][0]['class'] .= ' first';
  return theme_table($hdrs, $rows);
}

but I can't because $rows[0][0] might just be a string to display, so
I have to normalize it first.  (It also might span more than one
row/column but that is a separate issue.)

With your approach I can assume that $rows[0][0] is an array and can
safely write:

  $rows[0][0]['#attributes']['class'] .= ' first';

Right?  If so, then +1 from me.

Thanks,

Barry


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic