Header
Properties related to the header cells.
headerStyles
- Type:
HoverableStyles
- Default: unset
Styling details for the header elements in default and mouse hover states. To prevent the frame
component (index and add new column) from inheriting the header style, set inheritHeaderColors
property
in frameComponentsStyles
to false.
Example
- Sample code
- Full code
<active-table
headerStyles='{
"default": {
"backgroundColor": "#efefef",
"borderBottom": "unset",
"fontWeight": "700",
"fontSize": "15px"
},
"hoverColors": {
"backgroundColor": "#d2d2d2"
}
}'
></active-table>
<!-- This example is for Vanilla JS and should be tailored to your framework (see Examples) -->
<active-table
headerStyles='{
"default": {
"backgroundColor": "#efefef",
"borderBottom": "unset",
"fontWeight": "700",
"fontSize": "15px"
},
"hoverColors": {
"backgroundColor": "#d2d2d2"
}
}'
data='[
["Planet", "Diameter", "Mass", "Moons", "Density"],
["Earth", 12756, 5.97, 1, 5514],
["Mars", 6792, 0.642, 2, 3934],
["Jupiter", 142984, 1898, 79, 1326],
["Saturn", 120536, 568, 82, 687],
["Neptune", 49528, 102, 14, 1638]]'
tableStyle='{"borderRadius":"2px"}'
></active-table>
isHeaderTextEditable
- Type:
boolean
- Default: true
Controls if cell text can be edited for header cells.
Example
- Sample code
- Full code
<active-table isHeaderTextEditable="false"></active-table>
<!-- This example is for Vanilla JS and should be tailored to your framework (see Examples) -->
<active-table
isHeaderTextEditable="false"
data='[
["Planet", "Diameter", "Mass", "Moons", "Density"],
["Earth", 12756, 5.97, 1, 5514],
["Mars", 6792, 0.642, 2, 3934],
["Jupiter", 142984, 1898, 79, 1326],
["Saturn", 120536, 568, 82, 687],
["Neptune", 49528, 102, 14, 1638]]'
tableStyle='{"borderRadius":"2px"}'
></active-table>
allowDuplicateHeaders
- Type:
boolean
- Default: true
Allows multiple columns to have the same header text. If set to false and a duplicate is found the header text is defaulted to the value inside
defaultText
.
Example for false
- Sample code
- Full code
<active-table allowDuplicateHeaders="false"></active-table>
<!-- This example is for Vanilla JS and should be tailored to your framework (see Examples) -->
<active-table
allowDuplicateHeaders="false"
data='[
["Planet", "Planet", "Moons", "Moons", "Density"],
["Earth", 12756, 5.97, 1, 5514],
["Mars", 6792, 0.642, 2, 3934],
["Jupiter", 142984, 1898, 79, 1326],
["Saturn", 120536, 568, 82, 687],
["Neptune", 49528, 102, 14, 1638]]'
tableStyle='{"borderRadius":"2px"}'
></active-table>
displayHeaderIcons
- Type:
boolean
- Default: true
Displays an icon beside header text that represents the column type.
Example for false
- Sample code
- Full code
<active-table displayHeaderIcons="false"></active-table>
<!-- This example is for Vanilla JS and should be tailored to your framework (see Examples) -->
<active-table
displayHeaderIcons="false"
data='[
["Planet", "Diameter", "Mass", "Moons", "Density"],
["Earth", 12756, 5.97, 1, 5514],
["Mars", 6792, 0.642, 2, 3934],
["Jupiter", 142984, 1898, 79, 1326],
["Saturn", 120536, 568, 82, 687],
["Neptune", 49528, 102, 14, 1638]]'
tableStyle='{"borderRadius":"2px"}'
></active-table>
headerIconStyle
- Type: {
filterColor?: string
,
scale?
: {x?: number
,y?: number
}
} - Default: {
iconFilterColor: 'brightness(0) saturate(100%) invert(34%) sepia(0%) saturate(1075%) hue-rotate(211deg) brightness(96%) contrast(90%)',
scale: {x: 1.1, y: 1.1}
}
Styling details for the column header icons. The color is set by using the filterColor
property which requires
a filter string (the reason for this is because the icon is an SVG element)
that can be retrieved using the cssfilterconverter tool . Use scale
to resize the icon dimensions.
Example
- Sample code
- Full code
<active-table
headerIconStyle='{
"filterColor": "brightness(0) saturate(100%) invert(16%) sepia(85%) saturate(1892%) hue-rotate(210deg) brightness(88%) contrast(103%)",
"scale": {"x": 1.5, "y": 1.5}
}'
></active-table>
<!-- This example is for Vanilla JS and should be tailored to your framework (see Examples) -->
<active-table
headerIconStyle='{
"filterColor": "brightness(0) saturate(100%) invert(16%) sepia(85%) saturate(1892%) hue-rotate(210deg) brightness(88%) contrast(103%)",
"scale": {"x": 1.5, "y": 1.5}
}'
data='[
["Planet", "Diameter", "Mass", "Moons", "Density"],
["Earth", 12756, 5.97, 1, 5514],
["Mars", 6792, 0.642, 2, 3934],
["Jupiter", 142984, 1898, 79, 1326],
["Saturn", 120536, 568, 82, 687],
["Neptune", 49528, 102, 14, 1638]]'
tableStyle='{"borderRadius":"2px"}'
></active-table>
stickyHeader
- Type:
boolean
- Default: false or if
overflow
property is defined set to true
Header row will remain at the top of the table when there is overflow in the table or a parent element.
Example
- Sample code
- Full code
<active-table stickyHeader="true"></active-table>
<!-- This example is for Vanilla JS and should be tailored to your framework (see Examples) -->
<div style="maxHeight: 200px; overflow: auto">
<active-table
stickyHeader="true"
data='[
["Planet", "Diameter", "Mass", "Moons", "Density"],
["Earth", 12756, 5.97, 1, 5514],
["Mars", 6792, 0.642, 2, 3934],
["Jupiter", 142984, 1898, 79, 1326],
["Saturn", 120536, 568, 82, 687],
["Neptune", 49528, 102, 14, 1638]]'
tableStyle='{"borderRadius":"2px"}'
></active-table>
</div>
The scrollbar in this example is located on the parent div element, however when using the overflow
property
it would be placed directly on the actual table component.
dataStartsAtHeader
- Type:
boolean
- Default: false
Starts the index column count at header row and if pagination
is used the header row will not be displayed in pages after the first.
Example
- Sample code
- Full code
<active-table dataStartsAtHeader="true"></active-table>
<!-- This example is for Vanilla JS and should be tailored to your framework (see Examples) -->
<active-table
dataStartsAtHeader="true"
data='[
["Planet", "Diameter", "Mass", "Moons", "Density"],
["Earth", 12756, 5.97, 1, 5514],
["Mars", 6792, 0.642, 2, 3934],
["Jupiter", 142984, 1898, 79, 1326],
["Saturn", 120536, 568, 82, 687],
["Neptune", 49528, 102, 14, 1638]]'
tableStyle='{"borderRadius":"2px"}'
></active-table>