繁体   English   中英

drupal 6表theme()输出

[英]drupal 6 table theme() output

我正在制作一个drupal表,并查找了drupal_theme(),并尝试遵循以下代码来构建表的规则:

  $data = array('value', 'values');
  $header = array ($data);
  $rows = array(
    // Simple row
    array(
      'Cell 1', 'Cell 2', 'Cell 3'
    ),
    // Row with attributes on the row and some of its cells.
    array(
      'data' => array('Cell 1', array('data' => 'Cell 2', 'colspan' => 2)),
      'class' => 'funky'
    )
      );

  //$output = theme('table', $header, $rows, $attributes = array(), 
  //$caption = NULL);
  $table_t = theme_table($header, $rows, $attributes = array(), $caption = NULL);
  //return $output;
  return $table_t;

但是,该表不包含我期望的行和列标题。 怎么了??

截图: 在此处输入图片说明

我不确定这是否有帮助,但这是我在一个模块中使用的表头的代码。

  $header = array(
    array('data' => t('One')),
    array('data' => t('Two')),
    array('data' => t('Three')),
    array('data' => t('Four')),
  );

看看是否适合您。

此外, theme_table($header, $rows, $attributes = array(), $caption = NULL)可以只是theme_table($header, $rows)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM