DEV Community

Cover image for HTML tags | colgroup-col
Carlos Espada
Carlos Espada

Posted on • Edited on

1

HTML tags | colgroup-col

They are used to define groups of columns within a table. <colgroup> defines the total group of columns and <col> defines each of the columns in the group. It is useful for applying styles to entire columns, rather than repeating them for cells and in each row.

<colgroup> must be a child of a <table> element, after <caption> and before <thead>, <tbody>, <tfoot>, <tr> and <th>. It has a span attribute, which will contain a positive integer indicating the number of consecutive columns it spans. If not present, its default value is 1. This attribute cannot be used if the <colgroup> contains one or more <col> elements.

<col> has to be a child of a <colgroup> element. Like its parent, it has a span attribute that will contain a positive integer indicating the number of consecutive columns it spans. If it is not present, its default value is 1.

  • Type: table-column-group / table-column
  • Self-closing: No / No
  • Semantic value: No / No

Definition and example <colgroup> - Definition and example <col> | Support <colgroup> - Support <col>

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more