<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<title> using a div CSS to emulate a table diagonal </title>
<style type= "Text/css" >
*{padding:0;margin:0;}
Caption{font-size:14px;font-weight:bold;}
table{border-collapse:collapse;border:1px #525152 solid;width:50%;margin:0 auto;margin-top:100px;}
th,td{border:1px #525152 solid;text-align:center;font-size:12px;line-height:30px;background: #C6C7C6;}
Th{background: #D6D3D6;}
/* Analog Diagonal */
. out{
border-top:40px #D6D3D6 solid;/* Border Width is equal to the first row of table row Height */
width:0px;/* make the container width 0*/
height:0px;/* make the container height 0*/
border-left:80px #BDBABD solid;/* The width of the left border is equal to the first width of the first row of the table *
position:relative;/* let the two sub-containers inside absolutely position */
}
b{font-style:normal;display:block;position:absolute;top:-40px;left:-40px;width:35px;}
em{font-style:normal;display:block;position:absolute;top:-25px;left:-70px;width:55x;}
. T1{background: #BDBABD;}
</style>
<body>
<table>
<caption> using a div CSS to emulate a table diagonal </caption>
<tr>
<th style= "width:80px;" >
<div class= "Out" >
<b> category </b>
<em> name </em>
</div>
</th>
<th> Grade </th>
<th> class </th>
<th> Results </th>
<th> class Sharing </th>
</tr>
<tr>
<TD class= "T1" > Zhang San </td>
<td> three </td>
<td>2</td>
<td>62</td>
<td>61</td>
</tr>
<tr>
<TD class= "T1" > John Doe </td>
<td> three </td>
<td>1</td>
<td>48</td>
<td>67</td>
</tr>
<tr>
<TD class= "T1" > Harry </td>
<td> three </td>
<td>5</td>
<td>79</td>
<td>63</td>
</tr>
<tr>
<TD class= "T1" > Zhao Liu </td>
<td> three </td>
<td>4</td>
<td>89</td>
<td>66</td>
</tr>
</table>
<div><a href= "http://www.999jiujiu.com/" >http://www.999jiujiu.com/</A></div>
</body>
Simulating table diagonals with div css