HTML | Align Attribute - GeeksforGeeks

Skip to content geeksforgeeks
  • Courses
    • DSA Courses
    • Programming Languages
  • Tutorials
    • Python Tutorial
      • Python Loops and Control Flow
    • Java
      • Java Interview Questions
      • Java Quiz
      • Advance Java
    • Programming Languages
    • System Design
    • Interview Corner
    • Computer Science Subjects
    • DevOps
    • Linux
    • Software Testing
    • Databases
    • Android
    • Excel
    • Mathematics
  • DSA
    • Data Structures
    • Algorithms
      • Analysis of Algorithms
      • Searching Algorithms
      • Sorting Algorithms
    • Practice
      • Company Wise Coding Practice
      • Practice Problems Difficulty Wise
      • Language Wise Coding Practice
      • Curated DSA Lists
    • Company Wise SDE Sheets
    • DSA Cheat Sheets
    • Puzzles
  • Data Science
    • Data Science Packages
    • Data Visualization
    • Data Analysis
  • Web Tech
    • Web Development Using Python
      • Django
      • Flask
    • Cheat Sheets
  • HTML Tutorial
  • HTML Exercises
  • HTML Tags
  • HTML Attributes
  • Global Attributes
  • Event Attributes
  • HTML Interview Questions
  • HTML DOM
  • DOM Audio/Video
  • HTML 5
  • HTML Examples
  • Color Picker
  • A to Z Guide
  • HTML Formatter
Open In App HTML | <col> align Attribute Last Updated : 18 Feb, 2022 Summarize Comments Improve Suggest changes Like Article Like Save Share Report Follow

The HTML <col> align Attribute is used to set the horizontal alignment of text content inside the col element. It is not supported by HTML 5.

Syntax:

<col align="left | right | center | justify | char">

Attribute Values:

  • left: It sets the text left-align.
  • right: It sets the text right-align.
  • center: It sets the text center-align.
  • justify: It stretches the text of paragraph to set the width of all lines equal.
  • char: It sets the text-align to a specific character.

Example:

<!DOCTYPE html> <html> <head> <title> HTML col align Attribute </title> </head> <body> <h1>GeeksforGeeks</h1> <h2> HTML col align Attribute </h2> <table width="500" border="1"> <col align="center"> <tr> <th>Name</th> <th>Expenses</th> </tr> <tr> <td>BITTU</td> <td>2500.00</td> </tr> <tr> <td>RAKESH</td> <td>1400.00</td> </tr> </table> </body> </html>

Output:

Supported Browsers: The browser supported by HTML <col> align attribute are listed below:

  • Google Chrome: Not Supported
  • Internet Explorer: Not Supported
  • Firefox: Not Supported
  • Safari: Not Supported
  • Opera: Not Supported
Comment More info Next Article HTML | <colgroup> align Attribute author jit_t Follow Improve

Similar Reads

  • HTML | <col> align Attribute The HTML <col> align Attribute is used to set the horizontal alignment of text content inside the col element. It is not supported by HTML 5. Syntax: <col align="left | right | center | justify | char"> Attribute Values: left: It sets the text left-align. right: It sets the text right-al 1 min read
  • HTML | <colgroup> align Attribute The HTML <colgroup> align attribute is used to set the horizontal alignment of the text or content in the group of column. Syntax: <colgroup align="left|right|center|justify|char> Attribute Values: left: It sets the content to the left-align.right: It sets the content to the right-align. 1 min read
  • HTML | <caption> align Attribute The HTML <caption> align Attribute is used to specify the alignment of the <caption> Element. It is used to align the caption to the left, right, top and Bottom of a table. This attribute is not supported in HTML5. Note: By default , the table caption is aligned to center. Syntax: <ca 2 min read
  • HTML <p> align Attribute The HTML <p> tag is used to define paragraphs of text. In earlier versions of HTML, the align attribute was used to control the horizontal alignment of paragraph content. However, the align attribute for the <p> tag is deprecated in HTML5. Today, developers are encouraged to use CSS for 3 min read
  • HTML <div> align Attribute The HTML <div> align attribute was used to specify the horizontal alignment of content within a <div> element. However, this attribute is no longer supported in HTML5. Today, we use CSS for alignment purposes. Note: This attribute is not supported by HTML5. Syntax<div align="left | ri 3 min read
  • HTML <td> align Attribute The HTML <td> align attribute is used to set the horizontal alignment of text content. It uses the align attribute in HTML <td> to horizontally align text content within a table cell and it sets "left," "center," or "right" to control horizontal alignment. Note: The <td> align attr 2 min read
  • HTML <th> align Attribute The HTML <th> align Attribute is used to set the horizontal alignment of text content inside the table header cell. Instead, use CSS for alignment properties such as text-align to specify the horizontal alignment and vertical-align for vertical alignment within table headers. Note: The align a 2 min read
  • HTML <tr> align Attribute The HTML <tr> align Attribute is used to set the horizontal alignment of text content inside the table row. The HTML <tr> element itself doesn't have an align attribute. For aligning content within a table row, use the CSS text-align property on the individual <td> or <th> el 1 min read
  • HTML <img> align Attribute The HTML <img> align attribute sets an image's alignment relative to surrounding elements, allowing horizontal or vertical positioning. It is deprecated in HTML5 and replaced by CSS properties like float and vertical alignment for more flexible and modern alignment options. Note: The align att 3 min read
  • HTML <hr> align Attribute The HTML <hr> align Attribute is used to specify the alignment of the horizontal line. If the width attribute is not set to 100% then the align attribute will not create any effect. Note: The <hr> align Attribute is not supported by HTML5. Syntax: <hr align="left | center | right"> 1 min read
  • HTML | <thead> align Attribute The HTML <thead> align attribute is used to set the horizontal alignment of text content inside the table head (thead) section. Syntax: <thead align="left|right|center|justify|char"> Note: This attribute has been DEPRECATED and is no longer recommended. Attribute Value: left: It sets the 1 min read
  • HTML <table> align Attribute The HTML <table> align Attribute is used to specify the alignment of the table and its content. Instead of the align attribute, CSS properties like margin and text-align are preferred for table alignment. For aligning content within table rows or cells, use the align attribute within <tr 2 min read
  • HTML | <tbody> align Attribute The HTML <tbody> align Attribute is used to set the horizontal alignment of text content inside the table body (tbody). Syntax: <tbody align="left | right | center | justify | char"> Attribute Value: left: It sets the text left-align. right: It sets the text right-align. center: It sets 1 min read
  • HTML <input> align Attribute The HTML <input> align attribute is used with <input type=” image”> to set the horizontal alignment of the image. It is not supported by HTML 5. Note: Since <input type=” image”> is not supported by HTML5 you can use CSS there instead of this attribute. The syntax for CSS <input 1 min read
  • HTML | <tfoot> align Attribute The HTML <tfoot> align Attribute is used to set the horizontal alignment of text content inside the table footer (tfoot). It is not supported by HTML 5. Syntax: <tfoot align="left | right | center | justify | char"> Attribute Value: left: It sets the table footer text left-align. right: 1 min read
  • HTML | <object> align Attribute The HTML <object> align Attribute is used to specify an alignment for an object Element. It is an inline element means that can not insert a new line on a page. The text and other elements can also wrap around it. Note: This attribute is not supported by HTML5. Syntax: <object align="left | 1 min read
  • HTML | <legend> align Attribute The <legend> align attribute in HTML is used to specify the alignment of the caption in a <fieldset> element. The left and right alignment of <legend> element are supported by major browsers except Opera 12 and earlier versions. The bottom alignment are not supported by any browser 2 min read
  • HTML <iframe> align Attribute The HTML <iframe> align attribute is used to specify the alignment of the inline-frame according to the alternate element. Syntax <iframe align="left|right|middle|top|bottom"> Attribute Values left: It sets the alignment of an iframe to left.right: It sets the alignment of an iframe to r 1 min read
  • HTML | <col> char Attribute The HTML <col> char attribute is used to set the alignment of the content in a column in a character. It can only be used if the align attribute is set to "character". The default value of char is the decimal-point character of the page language. Syntax: <col char="character"> Attribute 1 min read
Article Tags :
  • HTML
  • Web Technologies
  • HTML-Attributes
Like three90RightbarBannerImg Explore More We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy Got It ! Lightbox Improvement Suggest changes Suggest Changes Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal. geeksforgeeks-suggest-icon Create Improvement Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all. geeksforgeeks-improvement-icon Suggest Changes min 4 words, max CharLimit:2000

What kind of Experience do you want to share?

Interview Experiences Admission Experiences Career Journeys Work Experiences Campus Experiences Competitive Exam Experiences

Từ khóa » Html Col Center