For my project I need a drop down box which will have 3 columns of text inside (to display; not actually). The problem is they are all numbers and need to be aligned right. I tried everything from calculating space to using CSS (white-space: pre), the <pre> tag or label but nothing works. While looking at the code it shows correct number of space being added to align but still it doesn't show up aligned in the drop down box.
Code: Select all
$pricing_price_break = "<select id='pricing_break' name='pricing_break'>";
$maxlen = 15;
// this whole section runs through loop to retrieve data from database for all three arrays - quantity, cost and price
whille($row=mysql_fetch_array($sql)){
// first part for option
$len = strlen($part_quantity_arr[$iiii]);
if($len<$maxlen){
for($i=$len+1; $x2y<=$maxlen; $x2y++){
$space1 .= " ";
}
}
// second part for option
$len = strlen($part_cost_arr[$iiii]);
if($len<$maxlen){
for($i=$len+1; $x2y<=$maxlen; $x2y++){
$space2 .= " ";
}
}
// third part for option
$len = strlen($part_price_arr[$iiii]);
if($len<$maxlen){
for($i=$len+1; $x2y<=$maxlen; $x2y++){
$space3 .= " ";
}
}
// putting everything together to create the option
$everything = "<pre>$space1$part_quantity_arr[$iiii]pc $space2$$part_cost_arr[$iiii] $space3$$part_price_arr[$iiii]</pre>";
$pricing_price_break .= "<option value=\"$iiii\">$everything</option>";
} // end of while loop
$pricing_price_break .= "</select>";
Thanks!
GBFAR