HTML <col> Tag
Description
The <col>
HTML element sets the width and other characteristics of one or more columns of a table. With this element, the browser starts showing the contents of the table, without waiting for it to fully load. <col>
can be used in conjunction with the <colgroup>
element, which defines a group of columns that share common characteristics.
Properties
- Permitted Parents
<colgroup>
only, though it can be implicitly defined as its start tag is not mandatory. The<colgroup>
must not have a span attribute.- Content
- None. It is an empty element.
- Start/End Tags
- Start tag: required, End tag: forbidden
Example
<table width="100%" border="1">
<col align="left"></col>
<col align="left"></col>
<col align="right"></col>
<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>
Attributes
Attribute | Definition |
---|---|
name | Marks an area of the page that a link jumps to. |
span | Specifies how many columns to span. |
width | Width of the column. |
align | Specifies the alignment of the content related to a col element. |
valign | Specifies the vertical alignment of the content related to a col element. |
char | Specifies the alignment of the content related to a col element to a character. |
charoff | Specifies the number of characters the content will be aligned from the character specified by the char attribute. |
Global Attributes
The <col>
tag also supports the Global Attributes in HTML5
Event Attributes
The <col>
tag also supports the Event Attributes in HTML5
Browser Support
Desktop | |||||
Yes | Yes | 1 | 1 | Yes | Yes |
Tablets / Mobile | |||||
![]() |
|||||
Yes | Yes | 4 | Yes | Yes | Yes |
Last updated by CSSPortal on: 6th December 2019
HTML Tags
- a
- abbr
- address
- area
- article
- aside
- audio
- b
- base
- bdi
- bdo
- blockquote
- body
- br
- button
- canvas
- caption
- cite
- code
- col
- colgroup
- comment
- datalist
- dd
- del
- details
- dfn
- dialog
- div
- dl
- doctype
- dt
- em
- embed
- fieldset
- figcaption
- figure
- footer
- form
- h1
- h2
- h3
- h4
- h5
- h6
- head
- header
- hr
- html
- i
- iframe
- img
- input
- ins
- kbd
- keygen
- label
- legend
- li
- link
- map
- mark
- menu
- meta
- meter
- nav
- noscript
- object
- ol
- optgroup
- option
- output
- p
- param
- picture
- pre
- progress
- q
- rp
- rt
- ruby
- s
- samp
- script
- section
- select
- small
- source
- span
- strong
- style
- sub
- summary
- sup
- table
- tbody
- td
- textarea
- tfoot
- th
- thead
- time
- title
- tr
- track
- u
- ul
- var
- video
- wbr