0

我正在尝试制定一个如下所示的时间表:

如您所见,我遇到的麻烦是添加时间,这是我的代码:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
 <title></title>
  </head>
  <style>
#teknik {
    background-color: #ffff80;
}
#rast {
    background-color: #c0c0c0;
}
#idrott {
     background-color: #ff0080;
}
#matte {
    background-color: #3686c2;
}
#fysik {
    background-color: #505064;
}
#svenska {
    background-color: #cc3366;
}
#kemi {
    background-color: #008080;
}
#prog {
     background-color: orange;
}
#engelska {
    background-color: #800080;
}
#webb {
    background-color: #ff8080;
}
p{
font-size: 10px;
}
table { 
table-layout: fixed; 
}


  </style>
  <body>
<table cellspacing="0" height="100%" width=100% cellpadding="0">
<td>
  <table id="monday" border="1px" height="100%" cellspacing="0" width=100%>
  <tr height="5%"><th>Måndag</th></tr>
  <tr id="teknik"><td height="70/455%"><p style="top:-13px;position:relative;">8.25</p>Datorteknik<p style="text-align:right;bottom:-15px;position:relative;">9.35</p></td></tr>
  <tr id="rast"><td height="25/455%"></td></tr> 
  <tr id="idrott"><td height="70/455%"><p style="top:-13px;position:relative;">10.00</p>Idrott och hälsa<p style="text-align:right;bottom:-15px;position:relative;">11.10 </p></td></tr>   
  <tr id="rast"><td height="45/455%"></td></tr> 
  <tr id="matte"><td height="40/455%">Matematik</td></tr>   
  <tr id="rast"><td height="10/455%"></td></tr>  
  <tr id="fysik"><td height="40/455%">Fysik</td></tr>
  <tr id="rast"><td height="155/455%"></td></tr>   
  </table></td>
<!-- Tisdag -->
<td>
  <table id="tisdag" border="1px" height="100%" cellspacing="0" width=100%>
  <tr height="5%"><th>Tisdag</th></tr>
  <tr id="rast"><td height="75/455%"></td></tr>
  <tr id="teknik"><td height="70/455%">Datorteknik</td></tr> 
  <tr id="rast"><td height="5/455%"></td></tr>   
  <tr id="svenska"><td height="70/455%">Svenska</td></tr> 
  <tr id="rast"><td height="35/455%"></td></tr>   
  <tr id="kemi"><td height="75/455%">Kemi</td></tr>  
  <tr id="rast"><td height="125/455%"></td></tr>    
  </table>
  </td>
<td>
  <table id="onsdag" border="1px" height="100%" cellspacing="0" width=100%>
  <tr height="5%"><th>Onsdag</th></tr>
  <tr id="rast"><td height="45/455%"></td></tr>
  <tr id="prog"><td height="140/455%">Programmering</td></tr> 
  <tr id="rast"><td height="45/455%"></td></tr>   
  <tr id="kemi"><td height="75/455%">Kemi</td></tr> 
  <tr id="rast"><td height="10/455%"></td></tr>   
  <tr id="matte"><td height="40/455%">Matematik</td></tr>
  <tr id="rast"><td height="10/455%"></td></tr>  
  <tr id="engelska"><td height="75/455%">Engelska</td></tr>   
  <tr id="rast"><td height="15/455%"></td></tr>    
  </table>
  </td>
<td>
  <table id="torsdag" border="1px" height="100%" cellspacing="0" width=100%>
  <tr height="5%"><th>Torsdag</th></tr>
  <tr id="kemi"><td height="80/455%">Kemi</td></tr>
  <tr id="rast"><td height="10/455%"></td></tr> 
  <tr id="webb"><td height="70/455%">Webbutveckling</td></tr>   
  <tr id="rast"><td height="65/455%"></td></tr>  
  <tr id="matte"><td height="85/455%">Matematik</td></tr>
  <tr id="rast"><td height="10/455%"></td></tr>  
  <tr id="fysik"><td height="80/455%">Fysik</td></tr>   
  <tr id="rast"><td height="55/455%"></td></tr>    
  </table>
  </td>
<td>
  <table id="fredag" border="1px" height="100%" cellspacing="0" width=100%>
  <tr height="5%"><th>Fredag</th></tr>
  <tr id="rast"><td height="145/455%"></td></tr>
  <tr id="webb"><td height="70/455%">Webbutveckling</td></tr>   
  <tr id="rast"><td height="40/455%"></td></tr>  
  <tr id="engelska"><td height="70/455%">Engelska</td></tr>
  <tr id="rast"><td height="5/455%"></td></tr>  
  <tr id="svenska"><td height="70/455%">Svenska</td></tr>
  <tr id="rast"><td height="5/455%"></td></tr>     
  <tr id="fysik"><td height="40/455%">Fysik</td></tr>  
  <tr id="rast"><td height="10/455%"></td></tr>    
  </table>
  </td>
  </table>
  </body>
</html>

请记住,我是 Web 开发/html 编码器的新手。

4

1 回答 1

0

我真的不明白您要做什么,因为您并没有真正包含任何实际代码,但是您是否考虑过实际使用表?

<table border="1">
    <thead>
        <tr>
            <th colspan="3">Mandag</th>
        </tr>
        <tr>
            <th>Start Time</th>
            <th>End Time</th>
            <th>Class Name</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>8:25</td>
            <td>9:35</td>
            <td>Datorteknik</td>
        </tr>
        <tr>
            <td>8:25</td>
            <td>9:35</td>
            <td>Datorteknik</td>
        </tr>
    </tbody>
</table>
于 2013-09-12T11:53:42.017 回答