colgroup tag | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

colgroup tag

wt is the function of <colgroup> and <col>?can anyone give me a clear example?

7th Oct 2017, 6:07 AM
Tharuja Sandeepanie
Tharuja Sandeepanie - avatar
1 Answer
+ 13
The HTML <colgroup>element defines a group of columns within a table. If the span attribute is present: none, it is an empty element. The start tag may be omitted, if it has a <col> element as its first child and if it is not preceded by a <colgroup> whose end tag has been omitted. <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>
7th Oct 2017, 6:22 AM
Apoorva Shenoy Nayak
Apoorva Shenoy Nayak - avatar