php - I want to add table structure in drop down list -


i want add 2 colums database table drop-down list.

i have fruits table in database, , want fetch name of fruit , it's quantity database , insert select drop-down list. should in option tag, , should in table structure.

<select  id="availablefruits" name="availablefruits" multiple size=7 style="width:auto;float:left;" >     <?php  $fruitlist=$this->fruitlist;         foreach ($fruitlist $key => $val)          {     printf('<option value="%s"><table><tr><td>%s</td><td>%s</td></tr></table></option>',$val,$val,$val);     //printf('<option value="%s">%s</option>', $val, $val);         }  ?> </select> 

this code drop-down list have written in html. here dynamically adding fruit's name , quantity in drop-down list, it's not printing in table structure.

the structure should like:

 <option value="%s"><table><tr><td>%s</td><td>%s</td></tr></table></option> 

for better use jquery plugin, display dropdown per choice

may below link http://www.jquery4u.com/plugins/10-jquery-selectboxdrop-down-plugins/


Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -