I think you are actually pretty close. Need to move your row echo statement outside of your while loop.
$query2 = "select * from room where room_number = '$room'";
while ($row= mysql_fetch_array($result_of_query2)) {
// Build your booking string by looping through dates
}
echo Booking String
By the way this is classic example of why seperating content from presentation is often a good thing. All the html code you have in there makes it difficult to read the code and even more difficult to modify it.
Have one section (perhaps a function) which queries the database, figues out which rrom is booked for which date and stores everything nicely into an array.
Then have a second routine which process the array and generates the html.