HTML colgroup tag
- 24-07-2022
- Trung Minh
- 0 Comments
The <colgroup> tag defines a group of one or more table columns for formatting purposes.
Use the <colgroup> tag in conjunction with the <col> tag to format columns.
How to use the <colgroup> . tag
For example , use the <colgroup> tag and the <col> tag to format the color of the columns in the table.
<!DOCTYPE html> <html> <head> <title>Học lập trình miễn phí tại web888.vn</title> <meta charset="utf-8"> </head> <body> <h1>Học lập trình miễn phí tại web888.vn</h1> <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> <tr> <td>5869207</td> <td>My first CSS</td> <td>$49</td> </tr> </table> </body> </html>
Attribute of <colgroup> . tag
The <colgroup> tag is provided with all the Global Attributes in HTML.