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

推荐订阅源

aimingoo的专栏
aimingoo的专栏
S
Securelist
博客园 - Franky
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
IT之家
IT之家
GbyAI
GbyAI
Microsoft Azure Blog
Microsoft Azure Blog
The Cloudflare Blog
云风的 BLOG
云风的 BLOG
N
News and Events Feed by Topic
AI
AI
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Schneier on Security
Schneier on Security
Attack and Defense Labs
Attack and Defense Labs
Vercel News
Vercel News
腾讯CDC
Google DeepMind News
Google DeepMind News
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
M
MIT News - Artificial intelligence
WordPress大学
WordPress大学
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
N
Netflix TechBlog - Medium
量子位
S
Schneier on Security
Hacker News: Ask HN
Hacker News: Ask HN
Cyberwarzone
Cyberwarzone
S
Security Affairs
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
N
News and Events Feed by Topic
T
Tenable Blog
PCI Perspectives
PCI Perspectives
MyScale Blog
MyScale Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Cyber Attacks, Cyber Crime and Cyber Security
W
WeLiveSecurity
N
News | PayPal Newsroom
P
Proofpoint News Feed
O
OpenAI News
C
CERT Recently Published Vulnerability Notes
B
Blog
Cisco Talos Blog
Cisco Talos Blog
Microsoft Security Blog
Microsoft Security Blog
V
Visual Studio Blog
MongoDB | Blog
MongoDB | Blog
大猫的无限游戏
大猫的无限游戏
A
Arctic Wolf
Y
Y Combinator Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Spread Privacy
Spread Privacy

博客园 - 爽爽

印章规格(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>