pub enum Scope {
Row,
Col,
Rowgroup,
Colgroup,
}Expand description
The scope attribute values for table header cells.
§Purpose
Specifies which cells a header (<th>) element applies to, improving
table accessibility by defining the relationship between headers and data.
§Usage Context
- Used with:
<th>elements only - Accessibility: Critical for screen readers to understand table structure
- Required: For complex tables with multiple header levels
§Valid Values
Row: Header applies to all cells in the same rowCol: Header applies to all cells in the same columnRowgroup: Header applies to row group (<tbody>,<thead>,<tfoot>)Colgroup: Header applies to column group (<colgroup>)
§Example
use ironhtml_attributes::{AttributeValue, Scope};
let scope = Scope::Col;
assert_eq!(scope.to_attr_value(), "col");<table>
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Age</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">John</th>
<td>30</td>
</tr>
</tbody>
</table>§WHATWG Specification
Variants§
Row
Header applies to all cells in the same row.
Col
Header applies to all cells in the same column.
Rowgroup
Header applies to all cells in the row group (<tbody>, <thead>,
or <tfoot>).
Colgroup
Header applies to all cells in the column group (<colgroup>).
Trait Implementations§
Source§impl AttributeValue for Scope
impl AttributeValue for Scope
Source§fn to_attr_value(&self) -> Cow<'static, str>
fn to_attr_value(&self) -> Cow<'static, str>
Convert to the attribute value string.
impl Copy for Scope
impl Eq for Scope
impl StructuralPartialEq for Scope
Auto Trait Implementations§
impl Freeze for Scope
impl RefUnwindSafe for Scope
impl Send for Scope
impl Sync for Scope
impl Unpin for Scope
impl UnwindSafe for Scope
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more