New Course: Mastering React Hooks Learn ASP.NET Core: Free Beginner Series Database Design Patterns Explained AWS Certification Prep Course Machine Learning Fundamentals

Creating HTML Tables Step-by-Step

HTML tables are created with the <table> element:

<table class="table table-bordered">
    <thead>
        <tr>
            <th>Header 1</th>
            <th>Header 2</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Row 1, Cell 1</td>
            <td>Row 1, Cell 2</td>
        </tr>
        <tr>
            <td>Row 2, Cell 1</td>
            <td>Row 2, Cell 2</td>
        </tr>
    </tbody>
</table>

Common table elements:

  • <tr> - Table row
  • <td> - Table data cell
  • <th> - Table header cell
  • <caption> - Table title

Creating Ordered, Unordered, and Description Lists

Unordered List

<ul>
    <li>Item 1</li>
    <li>Item 2</li>
</ul>

Ordered List

<ol>
    <li>First item</li>
    <li>Second item</li>
</ol>

Description List

<dl>
    <dt>Term 1</dt>
    <dd>Definition 1</dd>
    <dt>Term 2</dt>
    <dd>Definition 2</dd>
</dl>

Using Code and Preformatted Text in HTML

For displaying code:

<code>const x = 10;</code> // For inline code

<pre> // For code blocks
function example() {
    return "Hello";
}
</pre>

Combine with <samp> for sample output and <kbd> for keyboard input.

HTML Entities and Special Characters

Common HTML entities:

CharacterEntityDescription
<&lt;Less than
>&gt;Greater than
&&amp;Ampersand
ยฉ&copy;Copyright

Adding Emojis to Your Web Page

Three ways to add emojis:

  1. Directly paste emoji: ๐Ÿ˜Š
  2. Use HTML decimal code: &#128522; (๐Ÿ˜Š)
  3. Use HTML hex code: &#x1F60A; (๐Ÿ˜Š)

Ensure your document uses UTF-8 encoding:

<meta charset="UTF-8">

Using HTML Symbols

Common symbol entities:

  • &hearts; โ™ฅ Heart
  • &spades; โ™  Spade
  • &clubs; โ™ฃ Club
  • &diams; โ™ฆ Diamond
  • &trade; โ„ข Trademark
  • &euro; โ‚ฌ Euro

Character Sets and Encoding

Essential character encoding declarations:

<meta charset="UTF-8"> // HTML5
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> // Legacy

Common character sets:

  • UTF-8 - Unicode (recommended)
  • ISO-8859-1 - Latin alphabet
  • Windows-1252 - Western European

HTML URL Encoding Explained

URLs can only contain certain characters. Others must be encoded:

https://example.com/search?q=HTML%20Basics

Common URL encodings:

CharacterEncoding
Space%20
!%21
#%23

HTML vs XHTML โ€“ What's the Difference?

FeatureHTMLXHTML
Document Typetext/htmlapplication/xhtml+xml
Case SensitivityCase insensitiveCase sensitive
Tag ClosingOptional for someRequired for all
Attribute QuotesOptionalRequired

Modern web development typically uses HTML5.