Problem:
I am trying to align divs next to each other using float:left but I can’t get it to work. Instead, they are aligning under each other.
PHP code:
while ($row = mysql_fetch_assoc($result))
{
$kriterium .= '<div style="float:left;">'.$i.'</div>';
$betyg .= '<div style="float:left;">'.$row['RID'].'</div>';
$mean += $row['RID'];
$i++;
}
$meanvalue = round ($mean / ($i-1), 2);
$kriterium .= '<div style="float:left;"><b>Medelvärde</b></div>';
$betyg .= '<div style="float:left;"><b>'.$meanvalue.'</b></div>';
$html .= '
<div class="table table-condensed table-bordered neutralize">
<div>
<b>Kriterium</b>'.$kriterium.'
</div>
<div>
<b>Betyg</b>'.$betyg.'
</div>
</div>';
Desired output:

Question:
What is wrong with the CSS code that needs to be modified so that divs are aligned like columns next to each other?
You need to set a width for each div. The width of the first div will be wider than the width of the other divs.
http://jsfiddle.net/Zv7Dp/