!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""

創(chuàng)新互聯(lián)是一家專業(yè)提供阿克塞哈薩克族自治企業(yè)網(wǎng)站建設(shè),專注與成都網(wǎng)站建設(shè)、網(wǎng)站制作、H5頁面制作、小程序制作等業(yè)務(wù)。10年已為阿克塞哈薩克族自治眾多企業(yè)、政府機(jī)構(gòu)等服務(wù)。創(chuàng)新互聯(lián)專業(yè)網(wǎng)站設(shè)計(jì)公司優(yōu)惠進(jìn)行中。
html xmlns=""
head
meta http-equiv="Content-Type" content="text/html; charset=utf-8" /
title千聲盒子/title
style type="text/css"
/*不要使用標(biāo)簽名作為類名*/
/*.table{text-align:center;width:100%;height:100%;border-width:thin;border-style:solid;border-color:#AA9FFF;border-collapse:separate;}*/
.tbClass {
text-align:center;
width:100%;height:100%;
/*首先對(duì)大表格加上左邊 和 底邊*/
/*我自作主張加上了底邊框,可以刪掉去*/
/*聽說FF下不支持縮寫,請(qǐng)你自己把下面的寫法拆分出來*/
border-left:2px #AA9FFF solid; /* 左邊框 */
border-bottom:2px #AA9FFF solid; /*底邊框*/
}
.tbClass td {/*單元格的上邊和右邊*/
border-top:2px #AA9FFF solid;
border-right:2px #AA9FFF solid;
}
.tbClass td {/*測試用,為了看到效果,你可以把這個(gè)刪掉去*/
/*width:100px; height:80px;*/
}
/*專門為“盒子那行寫的類”*/
.boxCell td { height:101px; padding:0; margin:0}
/style
/head
body
table id="Box" name="Box" class="tbClass" cellspacing=0!--注意! 1:我把類名由table改成tbClass了, 2: cellspacing=0--
?php
for($i=1;$i=1000;$i++){
if($i%5==0){
echo "td$i/td";
echo "/tr
tr class=\"boxCell\"
td盒子/td
td盒子/td
td盒子/td
td盒子/td
td盒子/td
/tr
";/////注意! 這里使用了一個(gè)boxCell的CSS類,不會(huì)那么多冗余代碼
echo "tr";
}else{
echo "td$i/td";
}
}
?
/table
/body
/html
//////最后說明;
1。如果亂碼,或無顯示,請(qǐng)注意你php文件的編碼格式,或在瀏覽器下選擇GBK32編碼
2。這種專業(yè)問題,如果到Csdn 里發(fā)帖,十分鐘之內(nèi)就有人回答了
3。百度的BUG:回復(fù)后再修改,就不能保持代碼的縮進(jìn)了 -_-!即不能tab縮進(jìn),要換成4個(gè)空格
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " "
html xmlns=" "
meta http-equiv="Content-Type" content="text/html; charset=utf-8" /
title無標(biāo)題文檔/titlehtml
head
style type="text/css"
!--
.BG {border: 1px solid #FFCC00; br}
.BG1 {border: 1px dashed #CCCCCC; br}
.BG2 {border: 1px inset #3399CC; br}
.BG3 {border-top-width: 1px; brborder-right-width: 1px; brborder-bottom-width: 1px; brborder-left-width: 1px; brborder-top-style: dotted; brborder-right-style: solid; brborder-bottom-style: double; brborder-left-style: outset; brborder-top-color: #999999; brborder-right-color: #FF9900; brborder-bottom-color: #CC9999; brborder-left-color: #99CC00; br}
.BG4 {border-top-width: 1px; brborder-right-width: 1px; brborder-bottom-width: 1px; brborder-left-width: 1px; brborder-top-style: dashed; brborder-right-style: none; brborder-bottom-style: dashed; brborder-left-style: none; brborder-top-color: #FFCC00; brborder-right-color: #FFCC00; brborder-bottom-color: #FFCC00; brborder-left-color: #FFCC00; br}
--
/style
/head
body
table width="300" border="0" cellpadding="0" cellspacing="0" class="BG"
tr
td bgcolor="#FFFF99"div align="center"模擬百度的表格/div/td
/tr
tr
td/td
/tr
/table
p /p
table width="300" border="0" cellpadding="0" cellspacing="0" class="BG1"
tr
td bgcolor="#CCCCCC"div align="center"模擬很多BLOG表格/div/td
/tr
tr
td/td
/tr
/table
p /p
table width="300" border="0" cellpadding="0" cellspacing="0" class="BG2"
tr
tddiv align="center"新款式表格/div/td
/tr
tr
td/td
/tr
/table
p /p
table width="300" border="0" cellpadding="0" cellspacing="0" class="BG3"
tr
tddiv align="center"花式表格/div/td
/tr
tr
td/td
/tr
/table
p /p
table width="300" border="0" cellpadding="0" cellspacing="0" class="BG4"
tr
tddiv align="center"去任意邊表格/div/td
/tr
tr
td/td
/tr
/table
p /p
p /p
p /p
/body
/html
整個(gè)頁面的,復(fù)制看看把
xhtml如下:
div id="byitem"
h3 class="tabletitle"Widgets America (source by item)/h3
ul class="vert"
li class="tableheader"
ul class="horz"
liItem #/li
li class="name"Name/li
liColor/li
liIn Stock?/li
li class="price"Price/li
/ul
/li
li
ul class="horz"
li8476292163/li
li class="name"Cheese Widget/li
liGreen/li
liYes/li
li class="price"$3.14/li
/ul
/li
/ul
/div
CSS如下:
/* Widgets America (by item)
------------------------------------*/
div#byitem ul.vert {
list-style-type: none;
padding: 0;
margin: 0;
width: 540px;
}
div#byitem ul.vert li {
padding: 4px 0;
margin: 0;
height: 14px; /* space out your rows */
}
div#byitem ul.vert li.odd {
background-color: #eee;
}
div#byitem ul.horz {
clear: left;
list-style-type: none;
padding: 0;
margin: 0;
}
div#byitem ul.horz li {
float: left;
width: 80px;
padding: 0 20px 0 0;
margin: 0;
}
div#byitem ul.horz li.name { /* size your columns individually at the expense of ?
slightly bloated markup (labelling each appropriate li with this class) */
width: 130px;
}
div#byitem ul.horz li.price {
text-align: right;
padding-right: 0;
}
下面來個(gè)例子,你可以復(fù)制到你的編輯器里修改測試
style type="text/css"
table.gridtable {}{
font-family: verdana,arial,sans-serif;
font-size:11px;
color:#333333;
border-width: 1px;
border-color: #666666;
border-collapse: collapse;
}
table.gridtable th {}{
border-width: 1px;
padding: 8px;
border-style: solid;
border-color: #666666;
background-color: #dedede;
}
table.gridtable td {}{
border-width: 1px;
padding: 8px;
border-style: solid;
border-color: #666666;
background-color: #ffffff;
}
/style
!-- Table goes in the document BODY --
table class="gridtable"
tr
thInfo Header 1/ththInfo Header 2/ththInfo Header 3/th
/tr
tr
tdText 1A/tdtdText 1B/tdtdText 1C/td
/tr
tr
tdText 2A/tdtdText 2B/tdtdText 2C/td
/tr
/table
CSS(層疊樣式表)級(jí)聯(lián)樣式表是一種用來表現(xiàn)HTML(標(biāo)準(zhǔn)通用標(biāo)記語言的一個(gè)應(yīng)用)或XML(標(biāo)準(zhǔn)通用標(biāo)記語言的一個(gè)子集)等文件樣式的計(jì)算機(jī)語言。
網(wǎng)頁標(biāo)題:好看的css樣式表格,css樣式表的種類
標(biāo)題路徑:http://chinadenli.net/article43/dseeges.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供全網(wǎng)營銷推廣、定制網(wǎng)站、動(dòng)態(tài)網(wǎng)站、品牌網(wǎng)站設(shè)計(jì)、建站公司、小程序開發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)