Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

HTML col Tag

HTML col Tag with html tutorial, tags, anchor, img, div, entity, textarea, marquee, p tag, heading tag, h1, h2, table, formatting, attribute, elements, ol, ul, Input Types, block element tag, inline element tag, html tags, phrase tag, head, body, form, lists, symbols etc.

<< Back to HTML

HTML <col> tag

HTML <col> tag is used to specify common column properties for each column within <colgroup> element in an HTML table.

The <col> tag is useful when it requires to apply common style rules for each column cell rather than applying individually.


<col span=" "   style=" ">

Note: In HTML <col> tag does not require a closing tag but in XHTML it require a closing </col> tag.

Following are some specifications about the HTML <col> tag

Display Inline
Start tag/End tag Start tag(Empty tag)
Usage HTML tables

Example 1

<!DOCTYPE html>
	<title>Col tag</title>
<h2>Example of Col Tag</h2>
<table border="1">
		<col  span="2" style="background-color: #7fffd4">
		<col span="2" style="background-color: 	#98f5ff">
		<th>Roll No.</th>
Test it Now


HTML col tag


Tag-specific Attribute

element should contain. The default value of span attribute is 1.
Attribute Value Description
  • left
  • center
  • right
  • justify
  • char
It specifies the horizontal alignment of each column cell.
(Not supported in HTML5).
char character It specifies the alignment of content based on Characters in a column. It will be ignored if align is not set to char. (Not supported in HTML5).
charoff number It sets the number of characters to offset the column data from the alignment character specified by the char attribute. (Not supported in HTML5).
span number It specifies the number of the columns which a
  • top
  • middle
  • bottom
  • baseline
It specifies the vertical alignment of the columns.
(Not supported in HTML5).
  • %
  • Pixels
  • relative_length
It specifies the width of the column.
(Not supported in HTML5).

Global Attribute

HTML <col> tag supports all Global attributes in HTML.

Event Attribute

HTML <col> tag supports all event attributes in HTML.

Supporting Browsers

Elementchrome browser Chromeie browser IEfirefox browser Firefoxopera browser Operasafari browser Safari
Next Topic

Related Links:

Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf