Basic HTML
Tag | Description |
---|---|
<!DOCTYPE> |
Defines the document type |
<html> |
Contains metadata/information for the document |
<title> |
Defines a title for the document |
<body> |
Defines the document's body |
<h1> to <h6> |
Defines HTML headings |
<p> |
Defines a paragraph |
<br> |
Inserts a single line break |
<hr> |
Defines a thematic change in the content |
<!--..--> |
Defines a comment |
HTML Forms and Input
Tag | Description |
---|---|
<form> |
Defines an HTML form for user input |
<input> |
Defines an input control |
<textarea> |
Defines a multiline input control (text area) |
<button> |
Defines a clickable button |
<select> |
Defines a drop-down list |
<option> |
Defines an option in a drop-down list |
<label> |
Defines a label for an <input> element |
<optgroup> |
Defines a group of related options in a drop-down list |
<fieldset> |
Groups related elements in a form |
<legend> |
Defines a caption for a <fieldset> element |
<datalist> |
Specifies a list of pre-defined options for input controls |
<output> |
Defines the result of a calculation |
HTML Table
A table in HTML consists of table cells inside rows and columns.
Example :
<table>
<thead>
<tr>
<th>Name</th>
<th>Company</th>
<th>Country</th>
</tr>
</thead>
<tbody>
<tr>
<td>Jhontri Boyke</td>
<td>Google</td>
<td>Indonesia</td>
</tr>
<tr>
<td>Alex Boyle</td>
<td>Meta</td>
<td>France</td>
</tr>
<tr>
<td>Christine Angelrina</td>
<td>Tokopedia</td>
<td>Singapore</td>
</tr>
</tbody>
</table>
Here is the output :
![a photo of basic html table example](images/html-table.png)
HTML Table Tags
Tag | Description |
---|---|
<table> |
Defines a table |
<th> |
Defines a header cell in a table |
<tr> |
Defines a row in a table |
<thead> |
Group the header content in a table |
<tbody> |
Groups the body content in a table |
<tfoot> |
Groups the footer content in a table |
<caption> |
Defines a table caption |
<colgroup> |
Specifies a group of one or more columns in a table for formatting |
<col> |
Specifies column properties for each column within a <colgroup>
element |