2010-10-01 19 views

उत्तर

82

अहसास है कि आप colspan से परिचित नहीं हैं, मैं प्रकल्पित आप भी rowspan से परिचित नहीं हैं, इसलिए मैंने सोचा कि मुझे लगता है कि मुक्त करने के लिए में फेंक चाहते हैं।

एक महत्वपूर्ण बिंदु नोट करने के लिए, जब rowspan का उपयोग कर: निम्नलिखित tr तत्वों क्योंकि पिछली पंक्ति (या पिछले पंक्तियों) में rowspan का उपयोग कर कोशिकाओं के, कम td तत्व सम्मिलित होने चाहिए।

सीएसएस:

table {border: 1px solid #000; border-collapse: collapse; } 
th, td {border: 1px solid #000; } 

एचटीएमएल: पर

<table> 
    <thead> 
     <tr> 
      <th colspan="2">Column one and two</th> 
      <th>Column three</th> 
     </tr> 
    </thead> 
    <tbody> 
     <tr> 
      <td rowspan="2" colspan="2">A large cell</td> 
      <td>a smaller cell</td> 
     </tr> 
     <tr> 
      <!-- note that this row only has _one_ td, since the preceding row 
       takes up some of this row --> 
      <td>Another small cell</td> 
     </tr> 
    </tbody> 
</table> 

डेमो: jsbin

+20

यह सबसे अधिक * उत्साही * है, और दिल-वार्मिंग, प्रतिक्रिया मैंने कभी सुना है, एचटीएमएल टेबल पर चर्चा करते समय ... =) –

+1

इस डेमो को काफी जानकारीपूर्ण पाया गया है: http://www.w3schools.com/tags/ tryit.asp? फ़ाइल नाम = tryhtml_table_span – unmircea

14

कॉल्सपन:

<table> 
    <tr> 
     <td> Row 1 Col 1</td> 
     <td> Row 1 Col 2</td> 
</tr> 
<tr> 
     <td colspan=2> Row 2 Long Col</td> 
</tr> 
</table> 
संबंधित मुद्दे