网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 网站建设 > 代码交流
User Name
Password
 
FAQ Members List Calendar Cheap Glasses Mark Forums Read

代码交流 ASP,PHP,JSP等网站源代码下载与交流。

Reply
 
Thread Tools Display Modes
  #1   IP: 59.60.149.98
Old 2008-05-02, 05:34 PM
car car is offline
高级会员
 
Join Date: 2006-05-14
Posts: 534
car 正向着好的方向发展
Default 用css控制cellspacing、cellpadding

在table中控制单元格之间的间距要用到cellspacing、cellpadding,默认情况cellspacing、cellpadding均不为0,但经常的状况为了不让table单元格之间的间距影响到美观,我们经常会把cellspacing、cellpadding设置为0,因此经常看到“<table cellspacing=0 cellpadding=0>”这样的代码。这样做无形中增加了代码的体积,而且也极其不符合样式与内容分离的web标准,对于我本人来说也是极其厌恶这样的形式的,因此使用css控制cellspacing/cellpadding显的意义重大了!以下是控制方法:

Code:
table{border:0;margin:0;border-collapse:collapse;}
table td{padding:0;}
第一行控制cellspacing,关键是“border-collapse:collapse;”这一句;第二行控制cellpadding,很少人知道控制td吧?:)
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off

Forum Jump

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 10:53 PM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.