Forum Moderators: not2easy

Message Too Old, No Replies

Align radio button group

With text description under

         

Alternative Future

2:12 pm on Dec 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello to the group,

I was looking for a way to group 4 radio buttons on one line together within a table cell, with a short description center aligned under each radio.

<td>
<input type="radio> Radio1
<input type="radio> Radio2
<input type="radio> Radio3
<input type="radio> Radio4
</td>

Would be parsed like:
--O------O------O------O
Radio1 Radio2 Radio3 Radio4

Obviously ignore the -- I have used them to represent spaces ;)

TIA,

-Gs

justablink

2:48 pm on Dec 1, 2006 (gmt 0)

10+ Year Member



Try <td nowrap> and put the text Radio1, Radio2 etc. on the next line

Fotiman

3:46 pm on Dec 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Something like this?


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset:utf-8">
<title></title>
<style type="text/css">
#radioGroup label
{
float: left;
}
</style>
</head>
<body>
<table cellspacing="0">
<tr>
<td id="radioGroup">
<label for="radio1">
<input type="radio" id="radio1">
<div>Radio1</div>
</label>
<label for="radio2">
<input type="radio" id="radio2">
<div>Radio2</div>
</label>
<label for="radio3">
<input type="radio" id="radio3">
<div>Radio3</div>
</label>
<label for="radio4">
<input type="radio" id="radio4">
<div>Radio4</div>
</label>
</td>
</tr>
</table>
</body>
</html>

Alternative Future

3:50 pm on Dec 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks to both of you...

justablink your suggestion worked perfectly :)

Fotiman superb elegant solution which I shall be going with :)

Thanks so much

-Gs