Mono_Pic Trust & Quality
English     Urdu

Learn 04، Tables: organize information in rows and columns

Lesson 4: Tables

Goal: Organize data in rows and columns.

html

<table border="1">
    <thead>
        <tr>
            <th>Name</th>
            <th>Course</th>
            <th>Fee</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Ahmed</td>
            <td>HTML</td>
            <td>1200 SAR</td>
        </tr>
        <tr>
            <td>Ali</td>
            <td>CSS</td>
            <td>1500 SAR</td>
        </tr>
    </tbody>
</table>

Tag

Purpose

<table>

The whole table

<tr>

Table row

<th>

Header cell (bold, centered)

<td>

Data cell

<thead> / <tbody> / <tfoot>

Table sections

Merging cells: colspan="2" spans columns, rowspan="2" spans rows.

Key point: Tables are for data only, never for page layout.

Practice: Build your weekly timetable (day, subject, time).