用li列表模拟table式的表

今天我们看看如何通过li列表模拟表格,实现多列布局:
 
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > 
< html  xmlns ="http://www.w3.org/1999/xhtml" > 
< ! --xcf007 @ 2008-8-23-- > 
< head > 
< meta  http-equiv ="Content-Type"  content ="text/html; charset=utf-8"  /> 
< title >li模拟的表格 </title> 
< style  type ="text/css" > 


margin:0; 
padding:0; 
font-family:'宋体'; 
font-size:12px; 
line-height:12px; 



color:#666; 
text-decoration:none; 

html 

overflow:auto; 

ul 

width:808px; 
margin:0 auto; 
background-color:#FFF; 

div{ text-decoration:none; } 
li{list-style:none;_display:inline-block;overflow:hidden;} 
li a{display:block; float:left;width:200px; line-height:20px;text-align:center;background-color:#F4E3D0;margin:1px;} 
li a:hover{text-decoration:underline;} 
</style> 
</head> 
< body > 
   < div > 
     < ul > 
       < li > < a href="" >222 </a> < a href="" >3333 </a> < a href="" >333 </a> < a href="" >444 </a> </li> 
       < li > < a href="" >3333 </a> < a href="" >3333 </a> < a href="" >6666 </a> < a href="" >5555 </a> </li> 
       < li > < a href="" >7777 </a> < a href="" >3888 </a> < a href="" >999 </a> < a href="" >1000 </a> </li> 
     </ul> 
   </div> 
</body> 
</html> 
 
 
结果如下:
 
只是个模拟布局,实际中应该根据情况使用table.
 
很多人有个误区,觉得使用table很丢人,实际是不对的,注意无"table 布局"并非无"table",不行你可以看看去,xhtml并没有摒弃table标签。
 
所以对于正常的表格显示还是要使用table.






本文转自 xcf007 51CTO博客,原文链接:http://blog.51cto.com/xcf007/107717,如需转载请自行联系原作者

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值