惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tailwind CSS Blog
大猫的无限游戏
大猫的无限游戏
L
LINUX DO - 热门话题
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
雷峰网
雷峰网
aimingoo的专栏
aimingoo的专栏
博客园_首页
MongoDB | Blog
MongoDB | Blog
V
V2EX
GbyAI
GbyAI
量子位
Microsoft Azure Blog
Microsoft Azure Blog
有赞技术团队
有赞技术团队
G
Google Developers Blog
云风的 BLOG
云风的 BLOG
B
Blog
Microsoft Security Blog
Microsoft Security Blog
S
SegmentFault 最新的问题
O
OpenAI News
N
News and Events Feed by Topic
博客园 - Franky
爱范儿
爱范儿
Forbes - Security
Forbes - Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V2EX - 技术
V2EX - 技术
Application and Cybersecurity Blog
Application and Cybersecurity Blog
N
News and Events Feed by Topic
N
News | PayPal Newsroom
Schneier on Security
Schneier on Security
Cloudbric
Cloudbric
Security Archives - TechRepublic
Security Archives - TechRepublic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Recent Commits to openclaw:main
Recent Commits to openclaw:main
人人都是产品经理
人人都是产品经理
P
Privacy International News Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
B
Blog RSS Feed
阮一峰的网络日志
阮一峰的网络日志
D
DataBreaches.Net
Last Week in AI
Last Week in AI
罗磊的独立博客
Spread Privacy
Spread Privacy
Recent Announcements
Recent Announcements
The Cloudflare Blog
Google DeepMind News
Google DeepMind News
AWS News Blog
AWS News Blog
The Register - Security
The Register - Security
Y
Y Combinator Blog
J
Java Code Geeks
I
Intezer

博客园 - 爽爽

印章规格(2) 巧妙自制ps笔刷 当float遇到clear和clip 网站变黑白灰色的4种代码(转载) 15个CSS常识 CSS网页布局编码小技巧整理(转帖资料) word-break:break-all和word-wrap:break-word 自动换行问题 IE下神奇的一个Bug! 兼容IE6/IE7/IE8/FireFox的CSS hack - 爽爽 - 博客园 网页设计师的苦衷 基于栅格系统的web设计——灵与魂的融合 [欣赏] 2008年logo设计趋势 出水芙蓉——网页中的广告位 汗~注释也能影响兼容?!—css中遇到的变态问题 常用图片格式全解(收藏~转) 网页设计标准尺寸(文章很实用~转) 我拿青春赌明天!后果我自负~ 什么教学海无涯! 继续学习adobe Illustrator之泡泡字体
ul li实现table - 爽爽 - 博客园
爽爽 · 2009-02-10 · via 博客园 - 爽爽

目前知道的表格实现方式有3种,除了直接用table,下面代码是其中一种,还有一种是通过bg-color实现。下面这种的好处是兼容性比较好控制,只要清楚各种浏览器之间的margin和padding的差值就可以。

代码可以直接粘贴,对width和hight要求比较严格,根据自己的要求调整即可使用!

<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>不含table的表格</title>
<style type="text/css">
* {margin:0;padding:0}
#main {margin:100px 0 0 200px}
#main ul {width:520px;height:165px;list-style:none}
#main li {border-left:1px solid #ccc;border-top:1px solid #ccc;float:left;width:102px;height:33px;text-align:center;line-height:33px; color:#003399;}
#main li.b {border-bottom:1px solid #ccc}
#main li.r {border-right:1px solid #ccc}
</style>
</head>

<body>
<div id="main">
<ul>
<li>zss</li>
<li>zss</li>
<li>zss</li>
<li>zss</li>
<li class="r">zss</li>
<li></li>
<li></li>
<li></li>
<li></li>
<li class="r"></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li class="r"></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li class="r"></li>
<li class="b"></li>
<li class="b">兼容性</li>
<li class="b">IE6/7/8</li>
<li class="b">ff</li>
<li class="b r">Opera</li>
</ul>
</div>
</body>
</html>