Simulating table diagonals with div css

Source: Internet
Author: User

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http:// ">
<title> using a div CSS to emulate a table diagonal </title>
<style type= "Text/css" >
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 */
. T1{background: #BDBABD;}
<caption> using a div CSS to emulate a table diagonal </caption>
<th style= "width:80px;" >
<div class= "Out" >
<b> category </b>
<em> name </em>
<th> Grade </th>
<th> class </th>
<th> Results </th>
<th> class Sharing </th>
&LT;TD class= "T1" > Zhang San </td>
<td> three </td>
&LT;TD class= "T1" > John Doe </td>
<td> three </td>
&LT;TD class= "T1" > Harry </td>
<td> three </td>
&LT;TD class= "T1" > Zhao Liu </td>
<td> three </td>
<div><a href= "" ></A></div>

Simulating table diagonals with div css

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.