HTML
<table> 建立一表格。 <tbody> 表格內容開始。 <caption> **標題** </caption> <th> </th> 表示表頭單元格 <tr> </tr> 表頭單元格 - 包含表頭信息。 <td> </td> 代表一列。 </tbody> 表格內容完結。 </table> 建立完成。 <table border="1">邊框 <table rules="rows"> 欄位內距距離 rules=none 沒有線條。 rules=groups 位於行組和列組之間的線條。 rules=rows 位於行之間的線條。 rules=cols 位於列之間的線條。 rules=all 位於行和列之間的線條。
<table border="1" style="width:400px"> <tbody> <caption>**標題**</caption> <tr><td>第一行 欄位 1</td><td>第一行 欄位 2 </td></tr> <tr><td>第二行 欄位 1</td><td>第二行 欄位 2 </td></tr> </tbody> </table>
<table border="1" style="width:400px"> <tbody> <tr><th colspan="2">表頭單元格 - 包含表頭信息 </th>></tr> <tr><td>第二行 欄位 1</td><td>第二行 欄位 2 </td></tr> </tbody> </table>
<table border="10" style="width:400px"> <tbody> <tr><td>第一行 欄位 1</td><td>第一行 欄位 2 </td>></tr> <tr><td>第二行 欄位 1</td><td>第二行 欄位 2 </td></tr> </tbody> </table>
<table border="1" cellspacing="30" style="width:400px"> <tbody> <tr><td>第一行 欄位 1</td><td>第一行 欄位 2 </td>></td> <tr><td>第二行 欄位 1</td><td>第二行 欄位 2 </td></tr> </tbody> </table>
<table border="1" style="width:400px"> <tbody> <tr><td colspan="2" align="center">橫 二合併為一</td></tr> </td>></td> <tr><td>第二行 欄位 1</td><td>第二行 欄位 2 </td></tr> </tbody> </table>
<table border="1" style="width:400px"> <tbody> <tr><td rowspan="2">直二合併為一</td><td>第一行 欄位 2 </td></tr> <tr><td>第二行 欄位 2 </td></tr> </tbody> </table>
input type="text" <input type="text" size="20" value="123456" /> <input type="text" size="20" value="123456" onclick="this.select()" /> <input type="text" size="20" value="123456" onchange="this.select()" onclick="this.select()" /> <input type="text" size="20" value="123456" maxlength="10"/> <input type="text" size="20" value="123456" readonly /> <input type="text" size="20" value="123456" disabled /> <input type="text" value="123" onchange="alert(this.value)" />
input <input type="password" size="20" value="123456" /> <input type="number" size="20" value="123456" /> <input type="password" size="20" value="123456" onmouseover="this.select()" onmouseout="this.blur();" /> <input type="date"> <input type="month" > <input type="datetime-local"> <input type="time" > <input type="color" >
input <form action="demo_form.asp"> Quantity (between 1 and 5): <input max="5" min="1" name="quantity" type="number" /> </form> Quantity (between 1 and 5): <form action="demo_form.asp"> <input type="email" /></form> <input type="file" multiple >
<label class="container"> <input type="radio" name="S1" checked>One</label><br> <label class="container"> <input type="radio" name="S1" >Two</label><br> <label class="container"> <input type="radio" name="S1" >Three</label><br> <label class="container"> <input type="radio" name="S1" >Four</label> <style> .container { cursor: pointer; font-size: 22px; } </style>
<label class="container"> <input type="radio" checked>One</label><br> <label class="container"> <input type="radio" >Two</label><br> <label class="container"> <input type="radio" >Three</label><br> <label class="container"> <input type="radio" >Four</label> <style> .container { cursor: pointer; font-size: 22px; } </style>
<script> var Tag= document.querySelectorAll("input") ; Tag.forEach((round) => { round.addEventListener("click", function() { if(round.value== dp.innerHTML){ round.checked=false ; dp.innerHTML = "?";return } dp.innerHTML = round.value ; }) }) </script>
<script> var Tag= document.querySelectorAll("input") ; Tag.forEach((round) => { round.addEventListener("click", function() { var TT =document.getElementById("dp"+round.value) ; if(TT.style.opacity == 0.3){ TT.style.opacity=1; TT.style.textDecoration = "initial"; } else{ TT.style.opacity=0.3; round.checked=false ; TT.style.textDecoration = "line-through"; } }) }) </script>
<label class="container"> <input type="checkbox" checked="checked">One</label><br> <label class="container"> <input type="checkbox">Two</label><br> <label class="container"> <input type="checkbox">Three</label><br> <label class="container"> <input type="checkbox">Four</label> <style> .container { cursor: pointer; font-size: 22px; } </style>
<label class="container"> <input type="checkbox" checked="checked">One</label> <label class="container"> <input type="checkbox" >Two</label> <label class="container"> <input type="checkbox" >Three</label> <label class="container"> <input type="checkbox" >Four</label> <style> .container { cursor: pointer; padding-left: 30px; font-size: 22px; } </style>
<style> input[type="checkbox"]:checked ~ span{ color: red;} label {cursor:pointer;padding-left: 20px; font-size: 22px;} </style> <label> <input type="checkbox" > <span>One</span></label> <label> <input type="checkbox" > <span>Two</span></label> <label> <input type="checkbox" > <span>Three</span></label> <label> <input type="checkbox" > <span>Four</span></label>