傲视苍穹H5_VIP专题移动开发首页投稿(暂停使用,暂停投稿)

HTML列表、表格及表单

2016-10-03  本文已影响1122人  不住海边也喜欢浪

列表

<ol type="列表类型" start="起始编号"> <li>...</li> </ol>
type的属性值:
1:数字(默认)
a:小写字母
A:大些字母
i:小写罗马数字
l:大写罗马数字

<ul type="列表类型"> <li>...</li> </ul>
type的属性值:
disc:实心圆(默认)
circle:空心圆
square:实心矩形

<dl> <dt>一个术语</dt> <dd>这个术语的定义</dd> </dl>
dl:定义一个定义列表
dt:定义了定义列表中的一个术语
dd:对定义列表中的术语提供定义

<ul>
 <li>列表
  <ul>
   <li>有序列表</li>
   <li>无序列表</li>
   <li>定义列表</li>
  </ul>
 </li>
</ul>

表格

<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Author" content="就是喜欢浪">
  
  <title>Document</title>
 </head>
 <body>
  
  <table align="center" border="1" width="300" 
  height="300px" cellspacing="10"
  cellpadding="10">

  <caption>九宫格</caption>
 <thead>
  <tr align="center" valign="bottom">
    <td>1</td>
    <td>2</td>
    <td>3</td>
  </tr>
 </thead>

<tbody>
  <tr align="center" valign="bottom">
    <td>4</td>
    <td>5</td>
    <td>6</td>
  </tr>
</tbody>

<tfoot>
  <tr align="center" valign="bottom">
    <td>7</td>
    <td>8</td>
    <td>9</td>
  </tr>
 </tfoot>

 </table>

 </body>
</html>
九宫格.png
<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Author" content="就是喜欢浪">

  <title>Document</title>
 </head>
 <body>

  <table border="1" bordercolor="red" width="300" height="300" align="center" cellspacing="0" cellpadding="20" >

   <tr height="80" align="center" valign="top">
    <td colspan="2"></td>
    <td rowspan="2"></td>
   </tr>

   <tr>
    <td rowspan="2"></td>
    <td></td>
   </tr>

   <tr>
    <td colspan="2"></td>
   </tr>

  </table>
 </body>
</html>
跨行跨列表格.png
<!DOCTYPE html>
<html>
<head>
    <title>嵌套表格</title>
    <meta charset="UTF-8">
    <meta name="Author" content="就是喜欢浪">
</head>
<body>
  <table align="center" border="1" width="100" 
  height="50px" cellspacing="0">

   <tr>
    <td>1</td>
    <td>2</td>
   </tr>

   <tr>
    <td>3</td>
    <td><table border="1">

     <tr>
      <td>a</td>
      <td>b</td>
     </tr>

    </td>
   </tr>

  </table>
 </body>
</html>
嵌套表格.png

表单

```<input type="submit"/>`
2. 重置按钮

<input type="reset"/>
3. 普通按钮

<input type="button"/>与JS搭配使用
<button></button>

<input type="hidden"/>

<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Author" content="就是喜欢浪">

  <title>Document</title>
 </head>

 <body>
 
  <h1>修改个人信息</h1>
  <form name="form1" method="post" action="">
   <table border="1" width="300" height="400" cellspacing="0">
     
     <tr>
       <td width="100">姓名:</td>
       <td>

         <input name="user" type="text" required />

       </td>
     </tr>

     <tr>

      <td width="100">性别:</td>
      <td>
      
        <input type="radio" name="sex" value="man" checked/>男
        <input type="radio" name="sex" value="women"/>女

      </td>
     </tr>

     <tr>

      <td width="100">爱好:</td>
      <td>
      
        <input name="like" type="checkbox" value="game" checked/>游戏
        <input name="like" type="checkbox" value="siwim"/>游泳
        <input name="like" type="checkbox" value="boll"/>球
        <input name="like" type="checkbox" value="huaban"/>滑板
      
      </td>
     </tr>

     <tr>

      <td width="100">学历:</td>
      <td>
      
        <select name="xueli">
          
          <option value="ben">本科</option>
          <option value="zhuan">专科</option>
          <option value="other" selected>其他</option>

        </select>
      
      </td>
     </tr>
     
     <tr>

      <td width="100">意向工作城市:</td>
      <td>
      
        <select name="city" size="4">

         <option>北京</option>
         <option>上海</option>
         <option>广州</option>
         <option>深圳</option>
         <option>南昌</option>

        </select>
      
      </td>
     </tr>
     
     <tr>

      <td width="100">个人描述;</td>
      <td>
      
        <textarea name="description" cols="50" rows="8">请输入个人描述
        </textarea>
      
      </td>
     </tr>

     <tr>
      <td></td>
      <td>
      
       <input name="ispone" type="checkbox" id="isopen"/>
       <label for="isopen">请不要公开我的信息</label>
       <input name="serect" type="hidden" value="请不要公开我的信息"/><br/>
       <input type="file" value="myphone"/>
      
      </td>
     </tr>

     <tr>
      <td></td>
      <td>
        <input type="submit" value="OK"/>
        <input type="reset" value="重填"/></td>
     </tr>


   </table>

  </form>

 </body>
</html>
表单.png

以上就是这次分享的内容了,后面还会持续更新的,喜欢的小伙伴可以关注我

上一篇 下一篇

猜你喜欢

热点阅读