Table functions - from array to HTML table
Some functions useful when generating HTML tables from an array. Note that themeTabel() is standalone, but themeTable2() requires to supporting functions themeAttributes() and themeTableCell().
Some functions useful when generating HTML tables from an array. Note that themeTabel() is standalone, but themeTable2() requires to supporting functions themeAttributes() and themeTableCell().
This is how you can override Drupal 6 theme table using odd/even and let theme('table'...) group table rows by an ID (in this case by 'nid') and apply odd and even on the groups.
This is a very simple function to create a HTML table from an array. Some things are even hardcoded but can easily be either changed or modified to be more generic.
The Drupal 6 theme_table function is missing the ability to use tfoot tag for totals etc. This become hard when you add a jQuery table sorter and the totals start jumping around with the other rows. I made my own table function to get around this problem in Drupal 6. AS for now not even Druapl 7 have this feature.
This is how you can set up your own theme function and converting the same data sent to Drupal theme function for "table" and instead get it as a DIV structure. You need to add some CSS or styling the DIV structure to make it look like desired. This code is for a module.
This is how you can create a table from an array in Drupal. First loop your data and set an new array to have the ability to set class or id to cells or rows. Then call the theme() function in Drupal and format the output.
Trying to hide and show a table by JavaScript. Something is disturbing td in table when using style="display: block;" on table. (Using FF)
The with of the td loses the reference to the tables 100% and reference to its own content. But using display="block" works fine. The solution is to use a div with style="display: block;" around the table.
You have a Comma Separated Value (CSV) file on the server and want to convert it to a HTML table. This example use the first row as a header.