Course Content
Introduction
HTML, or HyperText Markup Language, is the foundational language for creating web pages and defining their structure. It is not a programming language but a markup language that uses elements and tags to describe content. Key Concepts: Elements and Tags: HTML documents are built using elements, which represent different parts of a web page (e.g., headings, paragraphs, images). Elements are defined using tags, which are keywords enclosed in angle brackets (e.g., <h1>, <p>, <img>). Most elements have an opening tag and a closing tag (e.g., <h1> and </h1>), with the content placed in between. The closing tag includes a forward slash before the element name. Some elements are self-closing and do not require a separate closing tag (e.g., <br> for a line break, <img> for an image). Basic Document Structure: Every HTML page begins with a declaration, which defines the document type. The entire HTML content is enclosed within the and tags. The section contains metadata about the page (e.g., title, character set, links to stylesheets), which is not directly visible on the page. The section contains all the visible content of the web page. Example of a basic HTML structure: Code <title>My First Web Page</title> <h1>Welcome to my page!</h1> <p>This is a paragraph of text.</p> Common Elements: Headings: <h1> to <h6> (for different levels of headings). Paragraphs: <p> (for blocks of text). Links: <a> (for creating hyperlinks to other pages or resources). Images: <img> (for embedding images). Lists: <ul> (unordered list), <ol> (ordered list), and <li> (list item). How to get started: Create a new text file and save it with a .html extension (e.g., index.html). Write your HTML code in the file using a text editor (like VS Code, Notepad++, or Sublime Text). Open the .html file in a web browser to view your web page.
0/10
HTML Coding
HTML tables are a fundamental component of web development used to display data in a structured, tabular format, similar to a spreadsheet. They organize information into rows and columns, making it easier for users to understand and interpret complex datasets.
Key HTML elements used to create tables include:
  • <table>The main container element that defines the entire table.
  • <tr>Represents a table row, containing one or more table data cells or header cells.
  • <td>Represents a standard table data cell, holding the actual content or data. 
     
  • <th>Represents a table header cell, used to define the headings for columns or rows. These are typically rendered in bold by default.
  • <thead>(Optional) Groups the header content in a table.
  • <tbody>(Optional) Groups the body content in a table.
  • <tfoot>(Optional) Groups the footer content in a table.
  • <caption>(Optional) Provides a short description or title for the table.
  • <colgroup> and <col>(Optional) Used for grouping and styling columns.
Example of a basic HTML table structure:
Code
 
<table>  <caption>Monthly Sales Report</caption>  <thead>    <tr>      <th>Month</th>      <th>Product A Sales</th>      <th>Product B Sales</th>    </tr>  </thead>  <tbody>    <tr>      <td>January</td>      <td>150</td>      <td>200</td>    </tr>    <tr>      <td>February</td>      <td>180</td>      <td>250</td>    </tr>  </tbody>  <tfoot>    <tr>      <td>Total</td>      <td>330</td>      <td>450</td>    </tr>  </tfoot></table>
HTML tables are primarily intended for presenting tabular data and should not be used for page layout or design purposes, as this can lead to accessibility and responsiveness issues. Modern web design utilizes CSS for layout and styling.