Coding with Sanjay Official

🎯 Welcome to Coding With Sanjay Official – CODING Seekhne Ki Pehli Seedhi Yahin Se Shuru Karein πŸ’»

Frontend & Functionality

Java Script

Coming SoonπŸ”’

Type Script

Coming SoonπŸ”’

Monday, July 27, 2026

HTML Table Tag Tutorial: Step-by-Step Guide in Hindi

πŸ”° Introduction

Agar aap HTML Table banana seekh rahe hain, to sirf theory padhna kaafi nahi hai. Real coding examples ki practice karna bhi bahut zaroori hai. Is example me hum ek simple Product-Price Table banana seekhenge jisme products aur unki prices ko rows aur columns ki help se display kiya gaya hai. Isse aap <table>, <tr> aur <td> tags ka practical use aasani se samajh paenge.

πŸ“ Description

Is example me humne ek simple HTML Table banayi hai jisme do products Laptop aur Mobile ke naam aur unki prices dikhai gayi hain. Browser me output ek clean aur well-organized Product-Price Table ke roop me dikhai dega, jisse information ko padhna aur compare karna bahut aasaan ho jata hai. Yeh example beginners ke liye HTML Table ka basic structure aur data ko rows aur columns me display karna sikhne ka ek behtareen practice example hai.

Agar aapne HTML Table ka theory article padh liya hai, to ab time hai ise practically samajhne ka πŸ’ͺ Practice ke bina coding complete nahi hoti.

HTML Table Rowspan and Colspan Tutorial Coding With Sanjay Official

πŸ‘‰ Is tutorial me hum basic se lekar advanced tak HTML table banana step-by-step seekhenge πŸš€


πŸ”° Step 1: Basic Table Banana

Sabse pehle ek simple table banana seekhte hain.


<table border="1">
  <tr>
    <td>Hello World</td>
  </tr>
</table>
Output:
Hello World

Ek simple table dikhega jisme ek box hoga aur usme "Hello World" likha hoga.


πŸ“Š Step 2: Rows aur Columns Add Karna

Ab hum multiple rows aur columns add karenge.


<table border="1">
  <tr>
    <td>HTML</td>
    <td>CSS</td>
  </tr>

  <tr>
    <td>JavaScript</td>
    <td>React</td>
  </tr>
</table>
Output:
HTML CSS
JavaScript React

Table me 2 rows aur 2 columns honge jisme technologies ke naam dikhenge.


🧩 Step 3: Heading Add Karna (<th>)

Table me heading add karne ke liye <th> tag use hota hai.


<table border="1">
  <tr>
    <th>Name</th>
    <th>Course</th>
    <th>Marks</th>
  </tr>

  <tr>
    <td>Sanjay</td>
    <td>HTML</td>
    <td>95</td>
  </tr>
</table>
Output:
Name Course Marks
Sanjay HTML 95

Table ke top me bold headings dikhenge aur neeche student ka data show hoga.


🎨 Step 4: Table Styling (CSS)

Ab table ko thoda professional look dete hain.


<table style="border-collapse:collapse; width:100%;" border="1">
  <tr>
    <th>Product</th>
    <th>Price</th>
  </tr>

  <tr>
    <td>Mobile</td>
    <td>10000</td>
  </tr>
</table>
Output:
Product Price
Mobile 10000

Table full width me dikhega aur borders clean aur joined honge.


🧱 Step 5: Border Control Karna

Border ko CSS se bhi control kiya ja sakta hai.


<style>
table, th, td {
  border: 1px solid red;
}
</style>

<table>
  <tr>
    <td>Data</td>
  </tr>
</table>
Output:
Data

Table aur cells ke around red border dikhega.


πŸ”„ Step 6: Colspan Use Karna

Column merge karne ke liye colspan use hota hai.


<table border="1">
  <tr>
    <th colspan="2">Student Info</th>
  </tr>

  <tr>
    <td>Name</td>
    <td>Sanjay</td>
  </tr>
</table>
Output:
Student Info
Name Sanjay

Heading 2 columns ke barabar width me dikhegi.


πŸ”„ Step 7: Rowspan Use Karna

Row merge karne ke liye rowspan use hota hai.


<table border="1">
  <tr>
    <td rowspan="2">Sanjay</td>
    <td>HTML</td>
  </tr>

  <tr>
    <td>CSS</td>
  </tr>
</table>
Output:
Sanjay HTML
CSS

Ek cell vertically 2 rows tak stretch karega.


πŸ§‘‍πŸ’» Step 8: Real Table Project

Ab ek real-life example dekhte hain (price table).


<table border="1">
  <tr>
    <th>Product</th>
    <th>Price</th>
  </tr>

  <tr>
    <td>Laptop</td>
    <td>50000</td>
  </tr>

  <tr>
    <td>Mobile</td>
    <td>15000</td>
  </tr>
</table>
Output:
Product Price
Laptop 50000
Mobile 15000

Ek clean product-price table dikhega jisme products aur unki price list hogi.


πŸ”— Helpful Links


🎯 Conclusion

πŸ‘‰ Ab aapne HTML table ko practically seekh liya hai πŸ’ͺ πŸ‘‰ Ab next step hai: Practice Exercises solve karo aur MCQ quiz do πŸš€

πŸ‘‰ Regular practice se hi aap expert banoge πŸ”₯


No comments:

Post a Comment