HTML Align Attribute - HTML Tutorials - W3resource
Có thể bạn quan tâm
align
The purpose of the HTML align attribute is to specify the alignment of data and the justification of text in a cell of a table.
Supported elements
HTML align attribute supports col, colgroup, tbody, td, tfoot, th, thead, tr elements.
Usage of align attribute for any other HTML elements is deprecated. You must use CSS for those.
Syntax
<ElementName align="value" >.....</ElementName>Where ElementName is any supported element.
Type of value
Type of value of HTML align attribute is predefined.
Values
Name | Description |
---|---|
left | Left align data, left justify text. |
center | Center align data, center justify text. |
right | Right align data, right justify text. |
justify | Double justify text. |
char | If used, text is aligned around a specific character. |
Default value
The default value of HTML align attribute is left.
Supported doctypes
HTML 4.01 strict, HTML 4.01 transitional, HTML 4.01 frameset.
Example of HTML align attribute with col, colgroup, tbody, td, tfoot, th, thead, tr
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Example of HTML align attribute with col, colgroup, tbody, td, tfoot, th, thead, tr </title> </head> <body> <table border="1"> <colgroup> <col><col align="char" char="."> <thead> <tr><th>Student Code</th><th>% of marks</th></tr> <tbody> <tr><td>S001</td><td>86.79</td></tr> <tr><td>S002</td><td>78.98</td></tr> <tr><td>S003</td><td>83.59</td></tr> </tbody> </table> </body> </html>Result
View this example in a separate browser window
Example of HTML align attribute with col, colgroup, tbody, td, tfoot, th, thead, tr.
Previous: HTML action attribute Next: HTML alt attribute
Từ khóa » Html Colgroup Align Right
-
HTML |
Align Attribute - GeeksforGeeks -
Using Text-align Center In Colgroup - Html - Stack Overflow
-
HTML Colgroup Align Attribute
-
HTML Colgroup Align Attribute - W3Schools
-
: The Table Column Group Element - MDN Web Docs -
HTML Colgroup Tag - W3Schools
-
HTML Colgroup Align Attribute - WEBDEVABLE
-
HTML Colgroup Align Attribute | Programming Tutorial
-
HTML Table Tutorial - HTML ALIGN - Linuxtopia
-
Styling Table Columns (COLGROUP, COL SPAN Etc.) - SitePoint
-
HTML Colgroup Align 属性| 菜鸟教程
-
Html – Using Text-align Center In Colgroup - ITecNote
-
HTML Colgroup Charoff Attribute - W3Schools
-
Tables In HTML Documents