当前位置: 动力学知识库 > 问答 > 编程问答 >

table - Making a schedule using css and html and cant put the time correctly

问题描述:

I'm trying to make a schedule that looks like this:

http://puu.sh/4pm0J.png

What I am having trouble with is adding the time as you see, here is my code:

<!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>

Please have in mind that I am new to webb development/html coder.

网友答案:

I don't really understand what you're trying to do since you didn't really include any of your actual code but have you thought about actually using tables?

<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>
分享给朋友:
您可能感兴趣的文章:
随机阅读: