Yesterday I need to upgrade GUI and function of existing project. One of files in this project, our old programmer use very very awesome code as follow:
2 <table width="100%" border="1">
3 <tr>
4 <th>ID</td>
5 <th>Name</td>
6 <th>AGE</td>
7 </tr>
8 </table>
9</span>
10<table width="100%" border="1">
11 <tr>
12 <td>1.</td>
13 <td>PPShein</td>
14 <td>28</td>
15 </tr>
16 <tr>
17 <td>2.</td>
18 <td>Rob</td>
19 <td>27</td>
20 </tr>
21</table>
I cannot convince why he/she didn't use simple CSS for floating table header. I think he/she might be weak in CSS for sure. Because look through above coding, some of web developer might say it's dirty code or not up to HTML structure. Ok, I need to edit something in this file for float table header as follow:
2 This CSS code must be in .css file.
3 As example, I just put CSS code in this file.
4--->
5<style>
6thead tr {
7 position: relative;
8 top: expression(this.offsetParent.scrollTop);
9}
10</style>
11
12<table width="100%" border="1">
13 <thead>
14 <tr>
15 <th>ID</td>
16 <th>Name</td>
17 <th>AGE</td>
18 </tr>
19 </thead>
20 <tbody>
21 <tr>
22 <td>1.</td>
23 <td>PPShein</td>
24 <td>28</td>
25 </tr>
26 <tr>
27 <td>2.</td>
28 <td>Rob</td>
29 <td>27</td>
30 </tr>
31 </tbody>
32</table>
Above my code is very simple and not dirty at all. And up to standard to HTML structure :) .

Android
Top of Page
#1 by Chris Blackwell on 12/9/10 - 8:31 AM
#2 by Richard on 12/9/10 - 8:51 AM
#3 by ppshein on 12/9/10 - 7:06 PM
What you said is right. IE only support for CSS expressions. But, my project only support for IE. :)
#4 by ppshein on 12/9/10 - 7:08 PM
I forgot to mention that our Project support for only IE because we use a lot of ActiveX controls and add-on. Thanks for your comment. :)
#5 by James on 1/13/12 - 5:05 PM
#6 by ppshein on 1/13/12 - 7:43 PM