Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537
.表格的制作
1、表格元素–<table>
表格中的行–<tr>
表格中的列–<td>
表格中的表頭–【居中/加粗】
table標(biāo)記的邊框–border
table標(biāo)記的寬度–width
table標(biāo)記的高度–height
table標(biāo)記的水平對(duì)齊方式–align
table標(biāo)記的表格背景色–bgcolor
table標(biāo)記的表格邊框色–bordercolor
table標(biāo)記的表格中的內(nèi)容與邊框之間的距離–cellpadding
table標(biāo)記的表格中的邊框與邊框之間的距離–cellspacing【默認(rèn)是1px】
tr標(biāo)記的align屬性–設(shè)置當(dāng)前行的水平對(duì)齊方式
tr標(biāo)記的bgcolor屬性–設(shè)置當(dāng)前行的背景色
tr標(biāo)記的valign屬性–設(shè)置當(dāng)前行的垂直對(duì)齊方式【top/middle/bottom】
td標(biāo)記的align屬性–設(shè)置當(dāng)前列的水平對(duì)齊方式
td標(biāo)記的bgcolor屬性–設(shè)置當(dāng)前列的背景色
td標(biāo)記的valign屬性–設(shè)置當(dāng)前列的垂直對(duì)齊方式【top/middle/bottom】
合并單元格
水平方向合并單元格–跨列—colspan
以下是計(jì)算器的控制面板代碼
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>計(jì)算器的控制面板</title>
</head>
<body>
<table border="1" cellspacing="10px" cellpadding="20px"
align="center" bgcolor="aliceblue">
<tr><td colspan="5" height="40px" align="right"><font size="7"><b>0</b></font></td></tr>
<tr align="center">
<td>MC</td>
<td>MR</td>
<td>MS</td>
<td>M+</td>
<td>M-</td>
</tr>
<tr align="center">
<td><-</td>
<td>CE</td>
<td>C</td>
<td>+/-</td>
<td>√</td>
</tr>
<tr align="center">
<td>7</td>
<td>8</td>
<td>9</td>
<td>/</td>
<td>%</td>
</tr>
<tr align="center">
<td>4</td>
<td>5</td>
<td>6</td>
<td>*</td>
<td>1/x</td>
</tr>
<tr align="center">
<td>1</td>
<td>2</td>
<td>3</td>
<td>-</td>
<td rowspan="2" bgcolor="yellow">=
</td>
</tr>
<tr align="center">
<td colspan="2">0</td>
<td>.</td>
<td>+</td>
</tr>
</table>
</body>
</html>
看成品:
2. 列表元素
2.1 有序列表
ol—有序列表
li—列表中的每一項(xiàng)【條目】
默認(rèn)的標(biāo)志是有順序的數(shù)字
我們可以通過ol的type屬性來修改標(biāo)志
1–有順序的數(shù)字
a–有順序的小寫字母
A–有順序的大寫字母
i–有順序的小寫羅馬數(shù)字
I–有順序的大寫羅馬數(shù)字
start屬性設(shè)置書順序的開始值
2.2 無序列表
ul—無序列表
li—列表中的每一項(xiàng)【條目】
默認(rèn)的標(biāo)志是實(shí)心點(diǎn)
我們可以通過ul的type屬性來修改標(biāo)志
circle–圓形【。】
disc----實(shí)心點(diǎn)[默認(rèn)]
square–正方形
none–沒有標(biāo)志
2.3 自定義列表
dl—自定義列表
dt—自定義列表的頭
dd—子項(xiàng)目
以下是有序,無序,和自定義列表
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>列表</title>
</head>
<body>
<ul type="none">
<li>無序列表</li>
<li>無序列表</li>
<li>無序列表</li>
</ul>
<ol type="A">
<li>有序列表</li>
<li>有序列表</li>
<li>有序列表</li>
</ol>
<dl>
<dt>自定義列表</dt>
<dt>自定義列表</dt>
<dt>自定義列表</dt>
</dl>
</body>
</html>
3. 表單<form>
主要負(fù)責(zé)采集信息的,可以將采集的信息提交。
form的屬性
action—指定表單數(shù)據(jù)的后端處理程序
method----指定表單數(shù)據(jù)的提交方式【get[默認(rèn)]/post】
get提交數(shù)據(jù)會(huì)將被處理的數(shù)據(jù)跟隨在請(qǐng)求地址之后
被提交的數(shù)據(jù)255個(gè)字符
https://www.baidu.com/s?&wd=html
post提交數(shù)據(jù)會(huì)將被處理的數(shù)據(jù)封裝到http協(xié)議的頭
https://www.baidu.com/s
被提交的數(shù)據(jù)沒有限制
通常情況下提交文件只能用post
enctype屬性規(guī)定在將表單數(shù)據(jù)發(fā)送到服務(wù)器之前如何對(duì)其進(jìn)行編碼。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<table border="1" align="center" cellpadding="20px" cellspacing="0">
<tr>
<td>application/x-www-form-urlencoded</td>
<td>在發(fā)送前對(duì)所有字符進(jìn)行編碼(默認(rèn))。</td>
</tr>
<tr>
<td>multipart/form-data</td>
<td>不對(duì)字符編碼。當(dāng)使用有文件上傳控件的表單時(shí),該值是必需的。
</td>
</tr>
<tr>
<td>text/plain</td>
<td>將空格轉(zhuǎn)換為 "+" 符號(hào),但不編碼特殊字符。</td>
</tr>
</table>
</body>
</html>
表單元素
input 文本框/密碼框/單選按鈕/復(fù)選框…
seletc 下拉列表
textarea 文本域—富文本編輯器
格標(biāo)簽:
table 表格標(biāo)簽
熟悉表格常用的單詞:
border 邊距,align 格式 :‘ center’ 對(duì)齊,cellspacing 單元格與單元格的距離,cellpadding 單元格與內(nèi)容的距離,wedth 寬度,height 高度,tr 表示:行,th 表示:表頭,td :表示列
編輯表格:
生成表格:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>表格標(biāo)簽</title>
</head>
<body>
<table border="" cellspacing="" cellpadding="">
<tr>
<th>姓名</th>
<th>性別</th>
<th>年齡</th>
</tr>
<tr>
<td>張三</td>
<td>男</td>
<td>18</td>
</tr>
<tr>
<td>李四</td>
<td>男</td>
<td>19</td>
</tr>
<tr>
<td>王五</td>
<td>男</td>
<td>20</td>
</tr>
</table>
</table>
</body>
</html>
用于呈現(xiàn)邏輯上并列的具有相關(guān)性的數(shù)據(jù)內(nèi)容.
<ul>
<li></li>
</ul>
disc: 實(shí)心圓點(diǎn)
circle: 空心圓圈
square: 實(shí)心正方形
<ol>
<li></li>
</ol>
1: 阿拉伯?dāng)?shù)字
i: 小寫羅馬數(shù)字
I: 大寫羅馬數(shù)字
A: 大寫字母
a: 小寫字母
適用呈現(xiàn)包含主題及描述的數(shù)據(jù)內(nèi)容.
<dl>
<dt>主題</dt>
<dd>描述</dd>
</dl>
表格
<table>
<thead>
<tr>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
</tr>
</tbody>
</table>
thead: 表頭
tbody: 表體
tfoot: 表腳
th: 專用于表頭中的單元格, 其具有自動(dòng)加粗并且居中的效果.
表格的屬性控制:
border: 邊框
bordercolor: 邊框顏色
width: 寬度
height: 高度
cellspacing: 單元格間距(外)
cellpadding: 單元格填充(內(nèi))
align: 表格的位置控制
單元格的屬性控制:
align
valign
如何合并單元格/跨行或跨列?
<td rowspan="number" colspan="number">
注意: 合并后, 會(huì)引發(fā)單元格數(shù)量的減少!
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<h1>我的電腦文件列表</h1>
<ul>
<li>我的電腦
<ul>
<li>本地磁盤(C:)
<ul>
<li>我的文檔</li>
<li>我的收藏</li>
</ul>
</li>
<li>本地磁盤(D:)
<ul>
<li>我的游戲</li>
<li>我的資料</li>
<li>我的電影</li>
</ul>
</li>
</ul>
</li>
</ul>
</body>
</html>
*請(qǐng)認(rèn)真填寫需求信息,我們會(huì)在24小時(shí)內(nèi)與您取得聯(lián)系。