By cwrighta70 on
I'm having a difficult time trying to get the theme_table to work properly. Here is what I'm trying to do:
I have a module that gets all taxonomy terms under a specific vocabulary. I provide each term as a link (using the l() function) to the term's children terms and nodes. Currently, these links are returned in the $page_content variable as a long list of categories like this:
Category 1
Category 2
Category 3
Category 4
Category 5
Category 6
...I'd like to put these links into a table (no headers, no borders) into a format more like this:
Category 1 Category 4 ...
Category 2 Category 5 ...
Category 3 Category 6 ...Can anyone give me some pointers? I've done some searching and read the API, but I've been unsuccessful so far.
Thanks!
Chris
Comments
Did you get as far as the
Did you get as far as the comments at the bottom of the API page? They spell it out pretty clearly, I would have thought. If you have read that part, maybe you can be more specific in your question, or provide a sample of the code that is not working for you.
http://api.drupal.org/api/drupal/includes--theme.inc/function/theme_table/6
Here is some of my module
Here is some of my module code. Right now I'm simply trying to get the table to show up at all. When $page_content is printed to the screen, all I get is "Array"...no table.
You have a typo in
You have a typo in theme_design_theme:
should be
Not sure if that's the cause of the problem though.
You could also simplify your loop a bit and fill in the blank tds:
I don't have time to test
I don't have time to test this now, but try getting rid of fn designs_theme and fn theme_designs_theme and restructuring fn designs_getCategories like so:
I'm afraid that's the holy
I'm afraid that's the holy grail of columnising in CSS...without resorting to CSS3 the only way you can do this is with an ugly loop that works out which column each category should be in and dynamically builds up the rows for the table.
This isn't an issue with theme_table at all, theme_table just takes the rows and columns you've defined and displays them. If you want special ordering you'll need to build the rows up in that special way yourself.