Row
Properties related to table rows.
rowHoverStyles
- Type: {
style: CSSStyle
,header?: boolean
,addNewRowButton?: boolean
} - Default: unset, but if style is set then header and addNewRowButton are true
Custom styling for row mouse hover. header
property denotes if style
can be applied to the header row
and addNewRowButton
denotes if style
can be applied to the add new row button if it is displayed.
Example
- Sample code
- Full code
<active-table rowHoverStyles='{"style":{"backgroundColor": "#d6d6d630", "transitionDuration": "0.05s"}}'></active-table>
<!-- This example is for Vanilla JS and should be tailored to your framework (see Examples) -->
<active-table
rowHoverStyles='{"style":{"backgroundColor": "#d6d6d630", "transitionDuration": "0.05s"}}'
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>
Custom default cell styles will override this property's styling. Additionally, using this property unsets the header (if set to true)
and frameComponentsStyles
hover color properties.
stripedRows
- Type:
boolean
| {odd?: CSSStyle
,even?: CSSStyle
} - Default: false, but if set to true then even is {backgroundColor: ''} and odd is {backgroundColor: '#dcdcdc7a'}}
Stripe based styling for rows.
Example
- Sample code
- Full code
<active-table stripedRows='{"odd": {"backgroundColor": ""}, "even": {"backgroundColor": "#ebebeb7a"}}'></active-table>
<!-- This example is for Vanilla JS and should be tailored to your framework (see Examples) -->
<active-table
stripedRows='{"odd": {"backgroundColor": ""}, "even": {"backgroundColor": "#ebebeb7a"}}'
cellStyle='{"borderBottom": "unset"}'
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='{"boxShadow": "rgb(172 172 172 / 17%) 0px 0.5px 1px 0px", "borderRadius":"2px"}'
></active-table>
Using this property unsets the default header and frameComponentsStyles
hover color properties.
If the component is set with a cellStyle
property - this will be overriden.
rowDropdown
- Type: {
displaySettings: DropdownDisplaySettings
,
isInsertUpAvailable?: boolean
,
isInsertDownAvailable?: boolean
,
isMoveAvailable?: boolean
,
isDeleteAvailable?: boolean
,
canEditHeaderRow?: boolean
} - Default: {
displaySettings: {isAvailable: true, openMethod: {cellClick: true}},
isInsertUpAvailable: true,
isInsertDownAvailable: true,
isMoveAvailable: true,
isDeleteAvailable: true,
canEditHeaderRow: true
}
Row dropdown settings. If displaySettings
object's openMethod
property has cellClick
set to true - simply click on the left-most
row cell to open the dropdown. If openMethod
is overlayClick
- hover over the left-most cell and click on the overlay.
The canEditHeaderRow
property denotes whether this dropdown can be used to change the header row e.g. move or delete it, therefore
it does not open on header row when set to false.
Example
- Sample code
- Full code
<active-table
rowDropdown='{"displaySettings":{"isAvailable": true, "openMethod": {"overlayClick": true}}, "canEditHeaderRow": false}'
></active-table>
<!-- This example is for Vanilla JS and should be tailored to your framework (see Examples) -->
<active-table
rowDropdown='{"displaySettings":{"isAvailable": true, "openMethod": {"overlayClick": true}}, "canEditHeaderRow": 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='{"boxShadow": "rgb(172 172 172 / 17%) 0px 0.5px 1px 0px", "borderRadius":"2px"}'
></active-table>
maxRows
- Type:
number
- Default: unset
Maximum number of rows allowed (including header row).
Example
- Sample code
- Full code
<active-table maxRows="4"></active-table>
<!-- This example is for Vanilla JS and should be tailored to your framework (see Examples) -->
<active-table
maxRows="4"
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>
dragRows
- Type:
boolean
- Default: true
Toggles the ability to change row positions by dragging index column cells or their overlays with your mouse.
Example
- Sample code
- Full code
<active-table dragRows="true"></active-table>
<!-- This example is for Vanilla JS and should be tailored to your framework (see Examples) -->
<active-table
dragRows="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>
Dragging rows is not available when using pagination
or filter
features.
displayAddNewRow
- Type:
boolean
- Default: true
A toggle for a clickable '+ New' row at the bottom of the table which is used to add new empty rows.
You can set the add new row style via frameComponentsStyles
.
Example
- Sample code
- Full code
<active-table displayAddNewRow="true"></active-table>
<!-- This example is for Vanilla JS and should be tailored to your framework (see Examples) -->
<active-table
displayAddNewRow="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>