HTML अवधि विशेषता
परिभाषा और उपयोग
span
विशेषता कॉलम की संख्या को परिभाषित करती है a या
<col>
तत्व <colgroup>
को फैलाना चाहिए।
पर लागू होता है
विशेषता का span
उपयोग निम्नलिखित तत्वों पर किया जा सकता है:
तत्वों | गुण |
---|---|
<col> | अवधि |
<कोलग्रुप> | अवधि |
उदाहरण
कर्नल उदाहरण
यहां, पहले दो स्तंभों की पृष्ठभूमि का रंग लाल होना चाहिए:
<table>
<colgroup>
<col span="2" style="background-color:red">
<col style="background-color:yellow">
</colgroup>
<tr>
<th>ISBN</th>
<th>Title</th>
<th>Price</th>
</tr>
<tr>
<td>3476896</td>
<td>My first HTML</td>
<td>$53</td>
</tr>
</table>
कोलग्रुप उदाहरण
<colgroup> span विशेषता का उपयोग करके पहले दो स्तंभों की पृष्ठभूमि का रंग सेट करें:
<table>
<colgroup span="2" style="background:red"></colgroup>
<tr>
<th>ISBN</th>
<th>Title</th>
<th>Price</th>
</tr>
<tr>
<td>3476896</td>
<td>My first HTML</td>
<td>$53</td>
</tr>
<tr>
<td>5869207</td>
<td>My first CSS</td>
<td>$49</td>
</tr>
</table>
ब्राउज़र समर्थन
विशेषता में span
प्रत्येक तत्व के लिए निम्नलिखित ब्राउज़र समर्थन है:
Element | |||||
---|---|---|---|---|---|
col | Yes | Yes | Yes | Yes | Yes |
colgroup | Yes | Yes | Yes | Yes | Yes |