Ho un problema, in pratica stavo provando un esercizio su un manuale di xhtml e javascript, solo che il risultato finale non è quello descritto dal libro, non capisco cosa sbaglio. Allora questo è il file htm:

codice:
<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
   <title>The Lighthouse</title>
   <link href="lhouse.css" rel="stylesheet" type="text/css" />
   <script type="text/javascript" src="list.js"></script>
   <script type="text/javascript"> 
     function amountTotal() {
      var total = 0 ;
      for (var i = 0; i < amount.length; i++) {
       total = total + amount[i]
       }
     return total     
     } 
   </script>
</head>

<body>

   <div id="title">
      [img]logo.jpg[/img]
      The Lighthouse

      543 Oak Street

      Owensboro, KY 42302

      (270) 555-7511
   </div>

   <div id="data_list">
     <script type="text/javascript"> 
      document.write("<table border='1' rules='rows' cellspacing='0'>");
      document.write("<tr>");
      document.write("<th>Date</th><th>Amount</th><th>First Name</th>");
      document.write("<th>Last Name</th><th>Address</th>");
      document.write("</tr>");
      for (var x = 0; x < amount.length; x++) {
          if (x % 2 == 0) {
          document.write("<tr>");
          } else {
          document.write("<tr class='yellowrow'>");
          }
      document.write("<td>" + date[x] + "</td><td class='amt'>" + amount[x] + "</td>");
      document.write("<td>" + firstName[x] + "</td><td>" + lastName[x] + "</td>");
      document.write("<td>" + street[x] + "
");
      document.write(city[x] + "," + state[x] + zip[x] + "</td>");
      document.write("</tr>");
      }
     </script> 
   </div>
   <div id="totals">
   <script type="text/javascript">
   document.write("<table border='1' cellspacing='1'>");
   document.write("<tr>");
   document.write("<th id='sumTitle' colspan='2'>");
   document.write("Summary");
   document.write("</th>");
   document.write("</tr>");
   document.write("<tr>");
   document.write("<th>Contributors</th>");
   document.write("<td>" + amount.length + "</td>");        
   document.write("</tr>");
   document.write("<tr>");
   document.write("<th>Amount</th>");
   document.write("<td>$" + amountTotal() + "</td>");
   document.write("</tr>");
   document.write("</table>");
   </script>
   </div>

</body>
</html>
Quest'altro invece è il foglio css:
codice:
#title                  {width: 600px; text-align:right; color: rgb(192,142,90); 
                         border-bottom: 1px solid rgb(232,182,130); 
                         margin-bottom:9px; font-size:10pt; height: 100px}
#title img              {float: left}

#data_list              {float: left}

table                   {font-size: 8pt; font-family: Arial, Helvetica, sans-serif; 
                         border: 1px solid brown; margin-right: 20px}
.yellowrow              {background-color: yellow}
th                      {color: white; background-color: brown; padding: 2px 5px}
td                      {vertical-align: top; padding: 2px 5px}
.amt                    {text-align: right}

#totals table           {font-size: 12pt}
#totals table th        {text-align: left}
#totals table td        {text-align: right; width: 75px}
#totals table #sumTitle {text-align: center; background-color: yellow; color: black}

In teoria la tabella dentro il div totals dovrebbe avere l'header chiamato sumTitle con lo sfondo giallo, ma nonostante l'abbia impostato su css, lo sfondo della cella sumTitle non cambia. Cosa ho sbagliato?
Altro problema: in teoria il div totals dovrebbe stare a destra, subito sotto l'indirizzo e a destra della prima tabella, ma anche se uso float non va; rimane sempre sul fondo, sotto la prima tabella. Qualcuno sa spiegami come posso fare o cosa sbaglio?
Ho iniziato da poco a studiare html,css e javascript, quindi scusate se magari sono errori banali. Grazie a tutti in anticipo. Sono bloccato da ore e non capisco perchè no nriesco a risolvere questi due problemi.
P.S.: oltre a questo c'è un file .js che contiene una serie di vettori che vengono inseriti automaticamente.