Way to seperate text and question from text area box in HTML

Viewed 32

I have this issue. I have written this HTML code, but I am unable to align between the question, yes/no buttons and text area box. My question has huge space from yes/no buttons, but when I drag the text area box and making it smaller, the question and yes/no buttons come closer as I wanted it to look. How can I fix this issue so my question is next to the yes/no buttons and box is underneath and doesn't move when I drag to make it bigger or smaller? photo of html and css result

<table cellspacing="2" cellpadding="2">
 <tr>        
    <td class="data_yy">
       <input type="radio" name="jack" id="jack" value="Y" onclick="hideShowJacks('Y');"/><label>Yes</label> 
       <input type="radio" name="jack" id="jack" value="N" checked onclick="hideShowJacks('N');"/><label>No</label>
   </td>
       <td class="data_xx"> Are are taking English class in fall?</td>
   </tr>
   <tr>
       <td>
       <textarea cols="120" rows="5" maxLenghth="20" class="resizable" name="jack" id="jack">    </textarea>
          <div class="plaintext" style="justify:left" id="jack">&nbsp;</div>
      </td>
   </tr>
</table>
1 Answers

So, this is a table, and you have two cells in the first row, and only one cell in the second row. You'll want that second cell to have colspan="2" as a property...

<td colspan="2">

And then, for the second part of your issue ("so my question [text] is next to the yes/no buttons"), you'll want to change the first yes/no cell to have <nobr> so it doesn't linebreak, and also set width="1"...

<td class="data_yy" width="1">

Made a quick working demo.

Does this look right?

Solution image

Related