Show Menu
Cheatography

Web Development Quiz2 Cheat Sheet (DRAFT) by

Web Development Quiz2

This is a draft cheat sheet. It is a work in progress and is not finished yet.

(Ch06) Making Tables

Table
<ta­ble­></­tab­le>
Table Row
<tr­>...</­tr>
Table Header
<tr­><t­h>T­ime­</t­h><­/tr>
Table Data
<td­>Na­tional News</­td>

(Ch06) Table border CSS

Border Collapse
border­-co­llapse: type (separate | collapse)
Border Spacing
border­-sp­acing: value;

(Ch06) Spanning Rows and Columns

Colspan (stretch row)
<th colspa­n="3­"­>total sum</t­h>
Rowspan (stretch col)
<td rowspa­n="2­"­>co­nte­nt<­/td>

(Ch06) Table Structure

Caption
<ca­pti­on>­con­ten­t</­cap­tio­n>
Table Header
<th­ead­><t­r>...<­/tr­></­the­ad>
Table Footer
<tf­oot­><t­r>...<­/tr­></­tfo­ot>
Column Groups
<ta­ble­><c­olg­rou­p>c­olu­mns­</c­olg­rou­p>table rows</­tab­le>

(Ch06) Table CSS

Caption Side
captio­n-side: position; (top | bottom)
Text Align
text-a­lign: position; (right | left)
Vertical Align
vertic­al-­align: type; (top | bottom | middle)
Display
display: type; (table | table-­inline | table-row | table-­row­-group | table-­hea­der­-group | table-­foo­ter­-group | table-­column | table-­col­umn­-group | table-cell | table-­caption
Columns
columns: width count;
Column Count
column­-count: value;
Column Rule
column­-rule: 2px solid gray;
 

(Ch06) Managing Column Breaks

Orphans
orphans: 2; (최소 몇 줄이 아래에 있어야 하는지)
Widows
widows: 1; (최소 몇 줄이 위에 있어야 하는지)
Break Before
break-­before: type; (auto | always | avoid)
Break After
break-­after: type; (auto | always | avoid)
Break Inside
break-­inside: type; (auto | avoid)
Column Span
column­-span: type; (none | all) (해당 요소가 전체 컬럼 차지)

(Ch07) Starting a Web Form

Form
<form action­="su­bmi­t.p­hp" method­="po­st">...<­/f­orm>
Script
<script src="rb­_fo­rsu­bmi­t.j­s"><­/sc­rip­t>
Field Set
<fi­eldset id="­cus­tIn­fo">...<­/f­iel­dse­t>
Legend
<le­gen­d>C­ont­act­</l­ege­nd>
Label
<label for="cu­stI­nfo­"­>사용­자명<­/la­bel>
Label + Input
<label for="vi­sit­"­>Date of visit<­/la­bel­><input name="v­isi­tDa­te" id="­vis­it" type="d­ate­" />

(Ch07) Creating a Selection List

Selection List
<select name="o­rde­rTy­pe" id="­ord­er"> <option value=­"­ord­er1­"­>Carry out</o­pti­on> <option value=­"­ord­er2­"­>De­liv­ery­</o­pti­on> <option value=­"­ord­er3­" select­ed>Dine in<­/op­tio­n> <option value=­"­ord­er4­"­>Take 'n bake</­opt­ion> </s­ele­ct>
Selection List To Scroll Box
<select size="4­"­>...</­sel­ect>
Multiple
<select multip­le>...<­/s­ele­ct>
Organize Selection List
<op­tgroup label=­"­lab­el1­"­><o­pti­on>­tex­t1<­/op­tio­n><­opt­ion­>te­xt2­</o­pti­on>­</o­ptg­rou­p>

(Ch07) Other Form Controls

Text Area
<te­xtarea name="c­omm­ent­" rows="4­"­></­tex­tar­ea>
Data List
<input type="t­ext­" list="s­ugg­est­ion­s" /> <da­talist id="­sug­ges­tio­ns">...<­/d­ata­lis­t>
 

(Ch07) Creating Input Boxes

Text
<input type="t­ext­" name="n­ame­" />
Password
<input type="p­ass­wor­d" name="p­wd" />
Email / Url
<input type="e­mai­l" name="e­mai­l" />
Radio
<input type="r­adi­o" name="c­hoi­ce" value=­"­A" checked />
Checkbox
<input type="c­hec­kbo­x" name="a­gre­e" value=­"­yes­" />
Submit / Reset
<input type="s­ubm­it" value=­"­reg­ist­er" />
Number
<input type="n­umb­er" min="1" max="10­" />
Range
<input type="r­ang­e" name="r­ate­" min="1" max="5" />
Radio Butto Example
<fi­eldset class=­"­opt­Gro­up">­<label for="fY­es">­Yes­</l­abe­l><­input name="s­Fri­end­" id="­fYe­s" value=­"­yes­" type="r­adi­o" /><­label for="fN­o">N­o</­lab­el>­<input name="s­Fri­end­" id="­fNo­" value=­"­no" type="r­adi­o" /><­/fi­eld­set>

(Ch07) Validation Attributes

Required
<input type="t­ext­" required />
Placeh­older
<input type="e­mai­l" placeh­old­er=­"­use­r@e­xam­ple.co­m" />
Pattern
<input type="t­ext­" patter­n="­\d{3­}-­\d{4­}" /> (전화번호 형식 지정)

(Ch07) Validation Styles

Focus
input:­focus { border: 2px solid blue; }
Valid
input:­valid { backgr­oun­d-c­olor: lightg­reen; }
Invalid
input:­invalid { backgr­oun­d-c­olor: pink; }
Checked
input[­typ­e=c­hec­kbo­x]:­checked + label { color: green; }