Aria-colspan - Accessibility - MDN Web Docs - Mozilla
Có thể bạn quan tâm
- References
- Accessibility
- ARIA
- ARIA states and properties
- aria-colspan
- English (US)
- Remember language
- Deutsch
- 中文 (简体)
- Description
- Example
- Values
- Associated interfaces
- Associated roles
- Specifications
- See also
- Accessibility
- Guides
- Accessibility information for web authors
- Accessibility: What users can do to browse more safely
- An overview of accessible web applications and widgets
- Keyboard-navigable JavaScript widgets
- Mobile accessibility checklist
- Understanding the Web Content Accessibility Guidelines
- Cognitive accessibility
- Accessibility and Spacial Patterns
- Web Accessibility: Understanding Colors and Luminance
- Web accessibility for seizures and physical reactions
- Learn accessibility
- Accessibility
- What is accessibility?
- HTML: A good basis for accessibility
- CSS and JavaScript accessibility best practices
- WAI-ARIA basics
- Accessible multimedia
- Mobile accessibility
- Assessment: Accessibility troubleshooting
- WCAG
- Overview
- Keyboard
- Operable
- Perceivable
- Robust
- Text labels and names
- Understandable
- ARIA
- ARIA guides
- ARIA guides
- ARIA live regions
- ARIA Screen Reader Implementors Guide
- Using ARIA: Roles, states, and properties
- Multipart labels: Using ARIA for labels with embedded fields inside them
- How to file ARIA-related bugs
- ARIA states and properties
- Overview
- aria-activedescendant
- aria-atomic
- aria-autocomplete
- aria-braillelabel
- aria-brailleroledescription
- aria-busy
- aria-checked
- aria-colcount
- aria-colindex
- aria-colindextext
- aria-colspan
- aria-controls
- aria-current
- aria-describedby
- aria-description
- aria-details
- aria-disabled
- aria-dropeffect Deprecated
- aria-errormessage
- aria-expanded
- aria-flowto
- aria-grabbed Deprecated
- aria-haspopup
- aria-hidden
- aria-invalid
- aria-keyshortcuts
- aria-label
- aria-labelledby
- aria-level
- aria-live
- aria-modal
- aria-multiline
- aria-multiselectable
- aria-orientation
- aria-owns
- aria-placeholder
- aria-posinset
- aria-pressed
- aria-readonly
- aria-relevant
- aria-required
- aria-roledescription
- aria-rowcount
- aria-rowindex
- aria-rowindextext
- aria-rowspan
- aria-selected
- aria-setsize
- aria-sort
- aria-valuemax
- aria-valuemin
- aria-valuenow
- aria-valuetext
- ARIA roles
- Overview
- ARIA: alert role
- ARIA: alertdialog role
- ARIA: application role
- ARIA: article role
- ARIA: banner role
- ARIA: button role
- ARIA: cell role
- ARIA: checkbox role
- ARIA: columnheader role
- ARIA: combobox role
- ARIA: command role
- ARIA: comment role
- ARIA: complementary role
- ARIA: composite role
- ARIA: contentinfo role
- ARIA: definition role
- ARIA: dialog role
- ARIA: directory role Deprecated
- ARIA: document role
- ARIA: document structural roles
- ARIA: feed role
- ARIA: figure role
- ARIA: form role
- ARIA: generic role
- ARIA: grid role
- ARIA: gridcell role
- ARIA: group role
- ARIA: heading role
- ARIA: img role
- ARIA: input role
- ARIA: landmark role
- ARIA: link role
- ARIA: list role
- ARIA: listbox role
- ARIA: listitem role
- ARIA: log role
- ARIA: main role
- ARIA: mark role
- ARIA: marquee role
- ARIA: math role
- ARIA: menu role
- ARIA: menubar role
- ARIA: menuitem role
- ARIA: menuitemcheckbox role
- ARIA: menuitemradio role
- ARIA: meter role
- ARIA: navigation role
- ARIA: none role
- ARIA: note role
- ARIA: option role
- ARIA: presentation role
- ARIA: progressbar role
- ARIA: radio role
- ARIA: radiogroup role
- ARIA: range role
- ARIA: region role
- ARIA: roletype role
- ARIA: row role
- ARIA: rowgroup role
- ARIA: rowheader role
- ARIA: scrollbar role
- ARIA: search role
- ARIA: searchbox role
- ARIA: section role
- ARIA: sectionhead role
- ARIA: select role
- ARIA: separator role
- ARIA: slider role
- ARIA: spinbutton role
- ARIA: status role
- ARIA: structure role
- ARIA: suggestion role
- ARIA: switch role
- ARIA: tab role
- ARIA: table role
- ARIA: tablist role
- ARIA: tabpanel role
- ARIA: term role
- ARIA: textbox role
- ARIA: timer role
- ARIA: toolbar role
- ARIA: tooltip role
- ARIA: tree role
- ARIA: treegrid role
- ARIA: treeitem role
- ARIA: widget role
- ARIA: window role
- Description
- Example
- Values
- Associated interfaces
- Associated roles
- Specifications
- See also
The aria-colspan attribute defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.
Description
Intended for cells and gridcells which are not contained in a native HTML <table>, the aria-colspan property value defines the number of columns spanned by an individual cell an ARIA table, grid, or treegrid.
In HTML, <th> and <td> elements have the colspan attribute. When using the semantic <table>, use the native colspan attribute as designed. This ARIA attribute is intended for cells and gridcells which are not contained in a native table, and will be ignored if used on a cell in a <table>.
Note: The first rule of ARIA use is if you can use a native feature with the semantics and behavior you require already built in, instead of repurposing an element and adding an ARIA role, state or property to make it accessible, then do so. Employ HTML <table> elements, including <td> and <th> with the colspan attribute instead of non-semantic elements with ARIA roles and attributes whenever possible.
The value of aria-colspan should be a positive integer. The default or assumed value of a cell span is 1. Make sure that the included value does cause the cell or gridcell to overlap the next cell or gridcell in the same row and does not cause the cell to span outside of the containing table, grid, or treegrid.
Example
The following is an example of part of a bowling tournament league scoring spreadsheet. Each game spans 10 frames, and each frame spans a 3 scores: two balls and the current total. The 10th (and last) frame in each game spans 4 columns in case someone is scoring all strikes.
html<div role="grid" aria-rowcount="27"> aria-label="Bowling League Scores" <div role="rowgroup"> <div role="row" aria-rowindex="1"> <!-- aria-rowspan and aria-colspan provide assistive technologies with the correct data cell header information when header cells span more than one row or column. --> <span role="columnheader" aria-rowspan="2">Team</span> <span role="columnheader" aria-colspan="2">Player</span> <span role="columnheader" aria-colspan="31">Game 1 Frames</span> <span role="columnheader" aria-colspan="31">Game 2 Frames</span> <span role="columnheader" aria-colspan="31">Game 3 Frames</span> <span role="columnheader" aria-rowspan="2">Total</span> </div> <div role="row" aria-rowindex="2"> <span role="columnheader">Last Name</span> <span role="columnheader">First Name</span> <span role="columnheader" aria-colspan="3">1</span> <span role="columnheader" aria-colspan="3">2</span> <span role="columnheader" aria-colspan="3">3</span> <span role="columnheader" aria-colspan="3">4</span> <span role="columnheader" aria-colspan="3">5</span> <span role="columnheader" aria-colspan="3">6</span> <span role="columnheader" aria-colspan="3">7</span> <span role="columnheader" aria-colspan="3">8</span> <span role="columnheader" aria-colspan="3">9</span> <span role="columnheader" aria-colspan="4">10</span> <span role="columnheader" aria-colspan="3">1</span> <span role="columnheader" aria-colspan="3">2</span> <span role="columnheader" aria-colspan="3">3</span> <span role="columnheader" aria-colspan="3">4</span> <span role="columnheader" aria-colspan="3">5</span> <span role="columnheader" aria-colspan="3">6</span> <span role="columnheader" aria-colspan="3">7</span> <span role="columnheader" aria-colspan="3">8</span> <span role="columnheader" aria-colspan="3">9</span> <span role="columnheader" aria-colspan="4">10</span> <span role="columnheader" aria-colspan="3">1</span> <span role="columnheader" aria-colspan="3">2</span> <span role="columnheader" aria-colspan="3">3</span> <span role="columnheader" aria-colspan="3">4</span> <span role="columnheader" aria-colspan="3">5</span> <span role="columnheader" aria-colspan="3">6</span> <span role="columnheader" aria-colspan="3">7</span> <span role="columnheader" aria-colspan="3">8</span> <span role="columnheader" aria-colspan="3">9</span> <span role="columnheader" aria-colspan="4">10</span> </div> </div> <div role="rowgroup"> <div role="row" aria-rowindex="10"> <span role="rowheader" aria-rowspan="3">The Mighty Quokkas</span> <span role="cell">Henderson</span> <span role="cell">Alice</span> <span role="cell">7</span> <span role="cell">/</span> <span role="cell">20</span> <span role="cell" aria-colspan="2">X</span> <span role="cell">39</span> <span role="cell">9</span> <span role="cell">-</span> <span role="cell">48</span> <span role="cell" aria-colspan="2">X</span> <span role="cell">76</span> <span role="cell" aria-colspan="2">X</span> <span role="cell">96</span> <span role="cell">8</span> <span role="cell">/</span> <span role="cell">113</span> <span role="cell">7</span> <span role="cell">-</span> <span role="cell">120</span> <span role="cell" aria-colspan="2">X</span> <span role="cell">146</span> <span role="cell" aria-colspan="2">X</span> <span role="cell">166</span> <span role="cell">6</span> <span role="cell">/</span> <span role="cell">X</span> <span role="cell">186</span> <span role="cell">7</span> <span role="cell">2</span> <span role="cell">9</span> <span role="cell">6</span> <span role="cell">-</span> <span role="cell">15</span> <span role="cell" aria-colspan="2">X</span> <span role="cell">35</span> <span role="cell">7</span> <span role="cell">/</span> … </div> <div role="row" aria-rowindex="11"> <span role="cell">McPherson</span> <span role="cell">Leslie</span> <span role="cell">9</span> <span role="cell">-</span> <span role="cell">9</span> <span role="cell">8</span> <span role="cell">1</span> <span role="cell">18</span> … </div> </div> </div>If we had used a <table> and semantic table elements our markup would have been less verbose and accessible by default.
Values
<integer>An integer greater than or equal to the default value of 1 defining the number of columns spanned by the cell. The value must be less than what would cause a cell to overlap the next cell in the same row.
Associated interfaces
Element.ariaColSpanThe ariaColSpan property, part of each element's interface, reflects the value of the aria-colspan attribute, which defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.
Associated roles
Used in roles:
- cell
Inherits into roles:
- columnheader
- rowheader
Specifications
Specification |
---|
Accessible Rich Internet Applications (WAI-ARIA) # aria-colspan |
See also
- The <th> and <td> colspan attribute
- aria-colindex property
- aria-rowspan property
- cell role
- columnheader role
- rowheader role
Help improve MDN
Was this page helpful to you?YesNoLearn how to contribute.This page was last modified on Jul 25, 2024 by MDN contributors.
View this page on GitHub • Report a problem with this contentTừ khóa » Html Td Colspan Style
-
HTML | Colspan Attribute - GeeksforGeeks
-
Element (table ...">Combining Colspan And Style="width:10px;" On
Element (table ... HTML Td Colspan Attribute - W3Schools
HTML Table Colspan & Rowspan - W3Schools
HTML |
colspan Attribute - GeeksforGeeks HTML Td Colspan Attribute - Dofactory
HTML Colspan Attribute - Dofactory
Table Rowspan And Colspan In HTML Explained (With Examples) »
How To Implement HTML Colspan With Examples? - EduCBA
CSS Colspan: How To Create Multiple Columns In Your HTML Tables
HTML Colspan Attribute - Tutorialspoint
What Are Table Rowspan And Colspan In HTML? - Tutorialspoint
How Do You Incorporate The Colspan Property Into The CSS File?
How To Create A Table In HTML - Linux Hint
Copyright © 2022 | Thiết Kế Truyền Hình Cáp Sông Thu