Add subtitles to register form I'm trying to add some titles in my registration form. This is a part of my registration form:



But now I would like to have some titles like the following:



I know that you can alter the registration form like this:

function mytheme_form_user_register_form_alter(&amp;$form, &amp;$form_state, $form_id) {

}


But I don't know which attributes or ... to use.

UPDATE:

I'm now trying out the markup.

This is what I do:

function xmed_form_user_register_form_alter(&amp;$form, &amp;$form_state, $form_id) {
    $form['account']['mail'] = array(
        '#markup' =&gt; '&lt;p&gt;testtttinnng&lt;/p&gt;',
        '#weight' =&gt; 116
    );
}


But this just replaces my email content ...
You can use Field group Contributed module...

Project page says..


  Fieldgroup will, as the name implies, group fields together. All
  fieldable entities will have the possibility to add groups to wrap
  their fields together. Fieldgroup comes with default HTML wrappers
  like vertical tabs, horizontal tabs, accordions, fieldsets or div
  wrappers.