Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 29th, 2012  |  syntax: None  |  size: 0.69 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.   // Table header
  2.   $header = array(
  3.     'fruit' => t('Fruit'),
  4.     'a'     => t('Vitamin A'),
  5.     'b1'    => t('Vitamin B1'),
  6.     'b2'    => t('Vitamin B2'),
  7.   );
  8.   // Table rows
  9.   $rows = array(
  10.     // Row 1
  11.     array(
  12.       'fruit' => t('Apple'),
  13.       'a'     => '98 IU',
  14.       'b1'    => '0.031 mg',
  15.       'b2'    => '0.047 mg',
  16.     ),
  17.     // Row 2
  18.     array(
  19.       'fruit' => t('Banana'),
  20.       'a'     => '76 IU',
  21.       'b1'    => '0.037 mg',
  22.       'b2'    => '0.086 mg',
  23.     ),
  24.     // Row 3
  25.     array(
  26.       'fruit' => t('Orange'),
  27.       'a'     => '295 IU',
  28.       'b1'    => '0.114 mg',
  29.       'b2'    => '0.052 mg',
  30.     ),
  31.   );
  32.   // Format and print out table.
  33.   print theme('table', $header, $rows);