Skip to content

Instantly share code, notes, and snippets.

@panlw
Created December 20, 2013 04:43
Show Gist options
  • Save panlw/8050489 to your computer and use it in GitHub Desktop.
Save panlw/8050489 to your computer and use it in GitHub Desktop.
Pure CSS table using UL and LI
<html>
<head>
<title>pure css table</title>
<style>
.b_lt {border-left: 1px solid #000; border-top: 1px solid #000;}
.b_rb {border-right: 1px solid #000; border-bottom: 1px solid #000;}
.table{background:None;}
.table ul{float:left;margin:0px;padding:0px;}
.table ul li{list-style:none;padding:4px 9px;}
.table ul li.title{font-weight:bold;background:#333;color:#fff;}
.table ul li.even{background:#fff;}
.table ul li.odd{background:#FFFFE6;}
</style>
</head>
<body>
<div class="table" style="margin: 1em;">
<ul class="b_rb">
<ul>
<li class="title b_lt">Country</li>
<li class="odd b_lt">India</li>
<li class="even b_lt">US</li>
<li class="odd b_lt">England</li>
<li class="even b_lt">Japan</li>
</ul>
<ul>
<li class="title b_lt">City</li>
<li class="odd b_lt">Mumbai</li>
<li class="evev b_lt">Washington</li>
<li class="odd b_lt">London</li>
<li class="even b_lt">Tokyo</li>
</ul>
</ul>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment