Lesson-6: Table kaise banate hai


Aaj hum HTML me table kaise banate hai ye janenge. HTMl me table ko banane ke liye hum <table> tag use karna hoga. Table me hume sabse pahle row ki jarurat padegi. iske liye hum <tr> (table row) tag ka use karenge. Maan lo apne ager ek row leni hai to aapko ek baar <tr> tag use karna hoga or uske ander jo data dena hai uske liye hum <th> (table heading) tag ka use karenge.
<table>
<tr><th>row1</th></tr>
</table>
output:-





aap table ko color or border size bhi de sakte hai. maan lo border maine 05 dena hai or color Red
<table border="05"bordercolor="red"bgcolor="green">
<tr><th>row1</th></tr>
</table>
output:





aap <th> tag se colomn create kar sakte hai maan lo mujhe tin colomn banane hai

<table border="10"bordercolor="red"bgcolor="green">
<tr>
<th>colomn1</th>
<th>colomn2</th>
<th>colomn3</th>
</tr>
</table>
output:




maan lo ager me 4 colomns or 3 row banana chahta hu. to uske liye me iss tarah se coding karunga.

<table border="10"bordercolor="red"bgcolor="green">
<tr>
<th>colomn1</th>
<th>colomn2</th>
<th>colomn3</th>
<th>colomn4</th>
</tr>
<tr>
<th>colomn1</th>
<th>colomn2</th>
<th>colomn3</th>
<th>colomn4</th>
</tr>
<tr>
<th>colomn1</th>
<th>colomn2</th>
<th>colomn3</th>
<th>colomn4</th>
</tr>
</table>
output:-

aab jitni row lena chahte hai uske liye aapko unti hi baar <tr> tag ko open or close karna hoga.
Table ke ander aap or bhi table bana sakte hai. uske liye aapko <td> (table data) tag ka use karna hoga.

maan lo ager me ek table ke ander 4 or table lena chahta hu to mujhe is tarah se coding karni hogi

<table border="05"bordercolor="red"bgcolor="blue">     chaar table ander lene ke liye <td> tag ka use kare
<td><table border="05"bordercolor="red"bgcolor="blue">
<tr>
<th>colomn1</th>
<th>colomn2</th>
</tr>
<tr>
<th>colomn1</th>
<th>colomn2</th>
</tr>
</table>
<td><table border="05"bordercolor="red"bgcolor="blue">
<tr>
<th>colomn1</th>
<th>colomn2</th>
</tr>
<tr>
<th>colomn1</th>
<th>colomn2</th>
</tr>
</table><td><table border="05"bordercolor="red"bgcolor="blue">
<tr>
<th>colomn1</th>
<th>colomn2</th>
</tr>
<tr>
<th>colomn1</th>
<th>colomn2</th>
</tr>
</table><td><table border="05"bordercolor="red"bgcolor="blue">
<tr>
<th>colomn1</th>
<th>colomn2</th>
</tr>
<tr>
<th>colomn1</th>
<th>colomn2</th>
</tr>
</table>
</table>

output:-





ager aap last ke do table ko first ke 2 table ke niche lana chahte hai to jaha pe second table ki coding ka </table> tag close huaa hai uske niche <tr> tag laga de or end me close kar de. to aapka output iss tarah se hoga:

ager kahi samajne me dikaat ho rhi hai to aap niche comment kar sakte hai ya phir mujse contact kar sakte hai.

Previous
Next Post »