Forum Moderators: open

Message Too Old, No Replies

Putting a table inside a HTML drop down select box

can it be done?

         

StoutFiles

5:15 pm on Oct 14, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have 4 columns of data.

¦data1¦data2¦data3¦data4¦

I need all 4 columns of data in the drop down box for the user to make a proper selection. However, just tossing the values in to the <option> categories results in columns that aren't lined up and confusion. I was wondering if there was a way to guarantee even column spacing throughout?

rocknbil

1:04 am on Oct 15, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not sure why this is in Javascript? No matter. So you're saying you want

<select name="data" id="data">
<option value="data1¦data2¦data3¦data4">data1¦data2¦data3¦data4 </option>
.....
</select>

Like that, with a select-one element?

If it's tabular data, dispense with the select and a table is what it's for:

<table>
<tr>
<td><input type="radio" name="data" id="dataset-1" value="dataset-1">
</td>
<td>data1</td>
<td>data2</td>
<td>data3</td>
<td>data4</td>
</tr>
.....
</table>

Of course, that might blow up your layout. You can hide some of the rows?

I don't think there's a solid formatting within the options though.