How to display the form fields of content type in a table using custom template file? I have created a content type Article including the fields Field 1, Field 2, Field 3 ......

All these fields have multiple values. I also created the custom template for this content type.

Now I want to display all fields of the form in a table and use only one button Add another item to add a line for all the fields.
Add the following snippet in template.php of your active theme;

&lt;?php
function THEMENAME_theme($existing, $type, $theme, $path) {
    return array(
        'article_node_form' =&gt; array(
            'arguments' =&gt; array('form' =&gt; NULL),
            'template' =&gt; 'node--add--article',
            'render element' =&gt; 'form',
            ),
    );
}
?&gt;


Then create a template file called node--add--article.tpl.php (same as the 'template' field in template.php.)

This is node--add--article.tpl.php:

&lt;table &gt;
  &lt;tr&gt;
    &lt;td&gt;&lt;?php print drupal_render_children($form['field_1']); ?&gt;&lt;/td&gt;
    &lt;td&gt;&lt;?php print drupal_render_children($form['field_2']);  ?&gt;&lt;/td&gt;
    &lt;td&gt;&lt;?php print drupal_render_children($form['field_3']);  ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;


&lt;?php print drupal_render_children($form);  ?&gt;


Now Clear Cache and see the result.