Hi,
I have a form with a textfield and submit button. I'd like to have the submit button next to the textfield. Not below.
Unfortunately, I can't quite get the alignment right, and have a feeling that <table>'s aren't the way to go. But I don't know how to use <div>'s to get the horizontal alignment right.
Could anyway give me some pointers?
The code I'm currently using is:
function theme_kat_keyword_form($form){
$output = '<table>';
$output .= '<tr><td width="100px">' . drupal_render($form['keyword']) . '</td>' .
'<td><div class="form-item"><label for="edit-keyword"> </label>' . drupal_render($form['submit']) . '<div class="description"> </div></div></td>';
$output .= '</tr></table>';
$output .= '<p>Please be patient. If the report is not cached then it make take a few moments to retrieve.</p>';
$output .= drupal_render($form);
return $output;
}// theme_kat_keyword_form
Comments
Do you know any CSS? If so
Do you know any CSS? If so that is the best way to go. It is not good to change drupal core code, if you ever upgrade you might forget to change that section of code and forget where it was.
With CSS you can move elements around to anywhere you want. Google "CSS basics" to get an idea. And then google "css forms" for more advanced features.
You're trying too hard,
You're trying too hard, forget about using a theme function do something like this instead;
Else, don't use
<div>tags, use<span>ones instead.Pobster