I have a section like
$myresult .= '<tbody>';
/*start printing the table wth feature and ratings */
for ($i = 1 ; $i < $numProperties; $i++){
if($master_rating_properties['rating'.$i.'_name']){
$myresult .= '<tr>';
$myresult .= '<td width=\'22%\'>';
$indfeature = 0;
$indfeature = $row_product['property'.$i.'_avg'];
$myresult .= $master_rating_properties['rating'.$i.'_name'].' ( '.$indfeature .')';
$myresult .= '</td>';
$myresult .= '<td colspan=\'0\' width=\'38%\' >';
$tocheck = $indfeature;
for($k = 0.5; $k <= 10.0; $k+=0.5){
$tocheck = roundOff($tocheck);
if(($tocheck) == $k) {
$chk = "checked";
} else {
$chk = "";
}
$myresult .= "<input class='star {split:2}' type='radio'";
$myresult .= " name='drating$i' id='drating$i$k' value='$k' '$chk'";
$myresult .= " title='$k out of 10' disabled '/>";
}
/* for k loop end */
/* added later ,was missing */
$myresult .= '</td>';
$myresult .= '</tr>';
}
/* end if loop */
}
/* end i for loop */
$myresult .= '</tbody>';
/* end tbody */
it works fine like printing the 10 stars(radio buttons) horizontally . but many a time all the 10 stars turn vertical.and after few browser refreshes it comes back to horizontal position. any idea .y this is causing problem? does tbody tag cause some problem.
i have done a demo page here. but its different form the code posted. that page i reverted back to old code. so posted this demo link to another page where this happens
http://abc.com/tempcollege . here also stars appears vertically sometimes.
First a question. why are you using tables to display layout? tables are for tabular data.
Given that you did not post the html, I am going to have to base this on a guess. I am guessing that the width 38% is not wide enough for the width of the 10 stars. so change that width to:
(width of star image) * 10 -> in pixels
and if you have any padding/margin/border/etc on the images, you will need to adjust the width accordingly.
edit:
Ok, I see it now. The problem is from a naughty div and a elements. The javascript does some fandangling to work around the IE box model problem... and the code is obviously screwing up. On reload, the javascript is telling the < div > tags to have a width of 85px and the < a > tags inside those div's to have a margin of -85px.
I recommend going to the google code page for that javascript and discussing this problem with them.