我创建了一个自定义表单,其中有四个元素。我想将所有这些元素放在一行中。怎么做 ?
我用谷歌搜索了它,找不到任何相关的东西..如果 CSS 有什么事情要做,那么请建议我将 DIV 放在哪里。
我在下面粘贴代码 -
<?php
function taskform_form(&$node, $form_state)
{
$form['date'] = array(
'#type' => 'date',
'#title' => t('Date'),
);
$form['edproject'] = array(
'#type' => 'select',
'#title' => t('Project'),
'#options' => array(
1 => 'Konnected',
2 => 'eLearning',
3 => 'Others',
),
'#description' => t('Choose a project'),
);
$form['task'] = array(
'#type' => 'textfield',
'#title' => t('Task'),
'#size' => 30,
'#required' => TRUE,
'#maxlength' => 30,
'#description' => t('Enter the task'),
);
$form['remarks'] = array(
'#type' => 'textarea',
'#title' => t('Remarks'),
'#size' => 30,
'#cols' => 6,
'#description' => t('Enter remarks (If any).'),
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Add Task'),
'#submit' => array('taskform_form_submit'),
);
return $form;
}