【发布时间】:2013-02-27 04:07:58
【问题描述】:
我写了一个表单模块,我想在其中制作文本字段的表格,但是它们的间距彼此相距很远,如图所示。我怎样才能让他们靠得更近?由于某种原因,行与列之间的间距非常远。我希望它们与大多数为网站构建的 HTML 表格一样彼此相邻。
其次,有没有办法将表单合并到drupal为常规文本内容提供的theme_table()中?这种格式对那些人来说真的很好。 --> http://coffeeshopped.com/2010/09/drupal-drag-and-drop-tables-in-custom-modules 我应该能够将 $form 填充到 theme_table() 的 $header 和 $row 数组中。 我发布了一个替代方案,这也是一个问题:drupal 6 form module not calling hook_theme
$form['a1'] = array(
'#type' => 'textfield',
'#title' => t('Date'),
'#prefix'=>'<table><tr><td>',
'#suffix'=>'</td>',
);
$form['a2'] = array(
'#type' => 'textfield',
'#title' => t('Amount Requested'),
'#prefix'=>'<td>',
'#suffix'=>'</td>',
);
$form['a3'] = array(
'#type' => 'textfield',
'#title' => t('Amount Recieved'),
'#prefix'=>'<td>',
'#suffix'=>'</td></tr>',
);
$form['b1'] = array(
'#type' => 'textfield',
'#prefix'=>'<tr><td>',
'#suffix'=>'</td>',
);
$form['b2'] = array(
'#type' => 'textfield',
'#prefix'=>'<td>',
'#suffix'=>'</td>',
);
$form['b3'] = array(
'#type' => 'textfield',
'#prefix'=>'<td>',
'#suffix'=>'</td></tr>',
);
$form['c1'] = array(
'#type' => 'textfield',
'#prefix'=>'<tr><td>',
'#suffix'=>'</td>',
);
$form['c2'] = array(
'#type' => 'textfield',
'#prefix'=>'<td>',
'#suffix'=>'</td>',
);
$form['c3'] = array(
'#type' => 'textfield',
'#prefix'=>'<td>',
'#suffix'=>'</td></tr></table>',
);
【问题讨论】:
-
您好,虽然我不会再复制、编辑、测试和发布您的代码,但我为此采用的解决方案是..