GETTING RADIO BUTTONS TO PRINT ALL ON ONE LINE
I pity those who beat their head against a wall like I did and tried everything.
I did solve it. Was too simple.
Situation was I had 200 questions with radio buttons for yes, no, maybe answers.
I wanted them alongside each other on same line as the question. FF worked fine then tried IE (Moz 4.0) and Safari. Was disgusting. Here's the final code I used (also note
I was generating dynamic html using php so if someone says it won't work, it's not true.)
The key was using the horrid
<pre> and </pre>
tags. I know with CSS this may be looked on in disfavor, but in this case it was the simplest solution. 2 lines of code.
This generates 200 lines of questions from a table. Maybe later I will upgrade it to a
MySQL application but the questions never change. Also notice use of the <<< notation so I can specify my own delimiter so I don't have to use those nasty backslashes to escape everything to the point where you can't read it.
foreach($Q_text as $item => $text)
{
$trim_text = trim($text);
echo <<<delim
<tr>
<pre>
<td class="left">
<input type="radio" class="radio" name="answer[$item]" value="+" />
<label class="left">+</label>
<input type="radio" class="radio" name="answer[$item]" value="M" />
<label class="left">M</label>
<input type="radio" class="" name="answer[$item]" value="-" />
<label class="left">-</label>
</td>
<td width="750" class="question" valign="top" >
<label>$trim_text</label>
</td>
</pre>
</tr>
delim;
}
This is sort of what it looks like (except I couldn't copy the buttons, only the labels of + (yes), M (maybe) and - (no),
+ M - 1) Do you make thoughtless remarks or accusations which later you regret?
Hope this helps you.