Unit 1

 1.8 HTML TABLES

HTML tables help organize data into rows and columns, making information easy to read and compare. They are useful for displaying schedules, price lists, product details, and more.

  • Can include text, images, links, and other elements
  • Built using tags like <table>, <tr>, <th>, and <td>
  • Allow clear presentation of data for comparison
  • Can be styled with CSS for better design and readability.
Example:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" 
          content="width=device-width, initial-scale=1.0">
    <title>HTML</title>
</head>
<body>
    <table>
        <tr>
            <th>Firstname</th>
            <th>Lastname</th>
            <th>Age</th>
        </tr>
        <tr>
            <td>Priya</td>
            <td>Sharma</td>
            <td>24</td>
        </tr>
        <tr>
            <td>Arun</td>
            <td>Singh</td>
            <td>32</td>
        </tr>
        <tr>
            <td>Sam</td>
            <td>Watson</td>
            <td>41</td>
        </tr>
    </table>
</body>
</html>

  • An HTML table is created using the <table> tag.
  • <tr> defines a table row.
  • <th> defines a table header cell (usually bold and centered).
  • <td> defines a table data cell that holds actual content.
  • Each <tr> represents one row containing <th> or <td> cells.
  • Cells can include text, images, lists, links, or even another table (nested table).

HTML Tables Tags

Here, is the list of all the tags that we used in table formation in html.

Tag

Description

<table>Defines the structure for organizing data in rows and columns within a web page.
<tr>Represents a row within an HTML table containing individual cells.
<th>Shows a table header cell that typically holds titles or headings.
<td>Represents a standard data cell, holding content or data.
<caption>Provides a title or description for the entire table.
<thead>Defines the header section of a table, often containing column labels.
<tbody>Represents the main content area of a table, separating it from the header or footer.
<tfoot>Specifies the footer section of a table, typically holding summaries or totals.
<col>Defines attributes for table columns that can be applied to multiple columns simultaneously.
<colgroup>Groups together a set of columns in a table to which you can apply formatting or properties collectively.

Comments

Popular posts from this blog

CS3492 Database Management Systems Syllabus

UNIT I RELATIONAL DATABASES

UNIT I RELATIONAL DATABASES