# Dynatrace SDK - DataTable :: CSS row hover

**URL:** <https://community.dynatrace.com/t/dynatrace-sdk-datatable-css-row-hover/49600>\
**Category:** Developer Q&A Forum\
**Tags:** custom-app\
**Created:** [January 7, 2025, 7:25pm UTC](https://community.dynatrace.com/t/dynatrace-sdk-datatable-css-row-hover/49600 "2025-01-07T19:25:07Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris\_cho](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chris_cho/32/23527_2.png) [@chris\_cho](https://community.dynatrace.com/u/chris_cho)\
**Post date:** [January 7, 2025, 7:25pm UTC](https://community.dynatrace.com/t/dynatrace-sdk-datatable-css-row-hover/49600/1 "2025-01-07T19:25:07Z")

</div>

How can I implement for a DataTable to highlight the **hovered** row?  
Not sure how to set the [_className_] property at the row level.

---

<div class="post-metadata">

**Author:** ![MikeleH](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mikeleh/32/41727_2.png) [@MikeleH](https://community.dynatrace.com/u/MikeleH)\
**Post date:** [January 9, 2025, 7:29am UTC](https://community.dynatrace.com/t/dynatrace-sdk-datatable-css-row-hover/49600/2 "2025-01-09T07:29:09Z")

</div>

Hey [@chris\_cho](https://community.dynatrace.com/user/84142) - the feature you’re looking for is natively supported and is called “interactiveRows” (so no css needed 🙂 ). I see that it’s missing from the docs, so will make sure that it’s added.

```tsx
<DataTableV2 data={data} columns={columns} interactiveRows />;

```

---

<div class="post-metadata">

**Author:** ![chris\_cho](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chris_cho/32/23527_2.png) [@chris\_cho](https://community.dynatrace.com/u/chris_cho)\
**Post date:** [January 9, 2025, 3:58pm UTC](https://community.dynatrace.com/t/dynatrace-sdk-datatable-css-row-hover/49600/3 "2025-01-09T15:58:17Z")

</div>

Hi [@MikeleH](https://community.dynatrace.com/user/3623), thank you for the quick response.  
It looks that this property is available to DataTableV2 but not to DataTable control.  
I will try to changing the implementation by using DataTableV2 but it doesn’t look like a straightforward transition considering that I also used other properties of DataTable as&nbsp;_columnVisibility_,&nbsp;_onColumnVisibilityChange_, _rowThresholds_, also distinct control that shows conditionally the _data is loading_ in the DataTable.

---

<div class="post-metadata">

**Author:** ![MikeleH](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mikeleh/32/41727_2.png) [@MikeleH](https://community.dynatrace.com/u/MikeleH)\
**Post date:** [January 10, 2025, 7:03am UTC](https://community.dynatrace.com/t/dynatrace-sdk-datatable-css-row-hover/49600/4 "2025-01-10T07:03:53Z")

</div>

Hey [@chris\_cho](https://community.dynatrace.com/user/84142) - the `DataTableV2` not only has feature parity with the `DataTable` but also has a lot more features. I would suggest migrating from the `DataTable` to the `DataTableV2`as we will be deprecating the `DataTable`.

In terms of migration, we have created a migration guide here: [https://developer.dynatrace.com/design/components-preview/tables/DataTableV2/migrationGuide/](https://developer.dynatrace.com/design/components-preview/tables/DataTableV2/migrationGuide/)

---

<div class="post-metadata">

**Author:** ![chris\_cho](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chris_cho/32/23527_2.png) [@chris\_cho](https://community.dynatrace.com/u/chris_cho)\
**Post date:** [January 10, 2025, 10:17pm UTC](https://community.dynatrace.com/t/dynatrace-sdk-datatable-css-row-hover/49600/5 "2025-01-10T22:17:41Z")

</div>

Hello&nbsp;[@MikeleH](https://community.dynatrace.com/user/3623)&nbsp;,

I have tried to implement the current logic by by manually changing the DataTable with DataTableV2 component.  
Unfortunately, following the examples given in Dynatrace Developer documentation, it doesn’t work for me.  
First,&nbsp;I found the&nbsp;_ **DataTableV2** _ component in “_@dynatrace/strato-components-preview/tables/ **DataTableV2/DataTableV2** _” instead of “@dynatrace/strato-components-preview/tables”.  
But, in “_@dynatrace/strato-components-preview/tables_” I found the component _ **\_DataTableV2** _ (prefixed with underscore)  
DataTableV2 component doesn’t recognize any of underneath elements such as Toolbar, VisibilitySettings,&nbsp;DownloadData.

Also, I followed the instructions provided in the migration guide:

- installed&nbsp;_ **jscodeshift**  
npm install -g jscodeshift_
- downloaded locally the file provided in the documentation -&nbsp;_ **migrate-datatable-datatablev2.js** _
- executed the migration script over an existing component file that includes the DataTable component.  
_npx jscodeshift --parser tsx -t \<path-to-downloaded-file\>\migrate-datatable-datatablev2.js \<path-to-target-component-file\>.tsx_
- still no success&nbsp;🤔

 ![chris_cho_2-1736545706553.png](https://global.discourse-cdn.com/dynatrace/original/3X/8/f/8fcabf450e4d072345dc4b4ca359e3e988150543.png)

I am not quite sure what I am missing. Please advise.

---

<div class="post-metadata">

**Author:** ![chris\_cho](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chris_cho/32/23527_2.png) [@chris\_cho](https://community.dynatrace.com/u/chris_cho)\
**Post date:** [January 11, 2025, 7:39am UTC](https://community.dynatrace.com/t/dynatrace-sdk-datatable-css-row-hover/49600/6 "2025-01-11T07:39:36Z")

</div>

Hello&nbsp;[@MikeleH](https://community.dynatrace.com/user/3623),

Checking again the app templates from Dynatrace GitHub, I updated the package.json versions for packages&nbsp;_[@dynatrace](https://community.dynatrace.com/user/64071)/strato-components_ and&nbsp;_[@dynatrace](https://community.dynatrace.com/user/64071)/strato-components-preview_

![chris_cho_0-1736580875330.png](https://global.discourse-cdn.com/dynatrace/original/2X/a/af0bb6bc2057f044833793d17f411d3aff576da8.png)

Afterwards, I executed _npx install_&nbsp;and&nbsp;_npx dt-app build_  
All good!&nbsp;Now, I can use the DataTableV2 component as expected and indeed I can see property&nbsp;_interactiveRows_.

Thanks

---

<div class="post-metadata">

**Author:** ![chris\_cho](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chris_cho/32/23527_2.png) [@chris\_cho](https://community.dynatrace.com/u/chris_cho)\
**Post date:** [January 11, 2025, 7:29pm UTC](https://community.dynatrace.com/t/dynatrace-sdk-datatable-css-row-hover/49600/7 "2025-01-11T19:29:20Z")

</div>

Hello&nbsp;[@MikeleH](https://community.dynatrace.com/user/3623),

After I setup the SDK to work with DataTableV2 component, and adjusted accordingly the code, I noticed that the control doesn’t work as expected, especially as looks-and-fills.  
My component page has a main DataTable component not page based but scroll controlled, based on the DataTable height property that is missing for the DataTableV2. The second DataTable is displayed based on a row action from the main DataTable. The data in these two tables could be as few rows up to few hundred rows. The idea using height property is to control the height of the DataTable controls, at least the main on. With vertical scroll is more convenient to find a record than having the DataTable page based.

 ![chris_cho_0-1736623653735.png](https://global.discourse-cdn.com/dynatrace/original/3X/6/4/648403e74631f6eecd1d2d7145d1242554572625.png)

On the other hand the new property _interactiveRows_, for DataTableV2 doesn’t work as expected. It doesn’t highlight the hovered row.

---

<div class="post-metadata">

**Author:** ![imsingh](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/imsingh/32/7858_2.png) [@imsingh](https://community.dynatrace.com/u/imsingh)\
**Post date:** [January 13, 2025, 11:03am UTC](https://community.dynatrace.com/t/dynatrace-sdk-datatable-css-row-hover/49600/8 "2025-01-13T11:03:01Z")

</div>

[@chris\_cho](https://community.dynatrace.com/user/84142)&nbsp;Hi there

Can you provide a codesandbox or a code snippet so that we can replicate what you’re doing?

This will help us in providing you better solution for your problem.

Thanks

Indermohan Singh

---

<div class="post-metadata">

**Author:** ![chris\_cho](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chris_cho/32/23527_2.png) [@chris\_cho](https://community.dynatrace.com/u/chris_cho)\
**Post date:** [January 13, 2025, 2:41pm UTC](https://community.dynatrace.com/t/dynatrace-sdk-datatable-css-row-hover/49600/9 "2025-01-13T14:41:33Z")

</div>

Hi&nbsp;[@imsingh](https://community.dynatrace.com/user/52863),

For now, we are fine with what I accomplished. The code of component page is quite complex to share.  
Here is just a screenshot with the code for DataTableV2, having the property [**height**] no longer available.

 ![chris_cho_0-1736779135280.png](https://global.discourse-cdn.com/dynatrace/original/3X/a/0/a0e763e561c054e9e63a79c7c7639f1f05edd8c0.png)

However, I will check later again the coming releases which may include the _ **DataTableV2** _ and _ **SelectV2** _.  
Quite same it’s for SelectV2 component. I couldn’t set the height of the dropdown list, to scroll the elements based on vertical scrollbar. The dropdown list extends the page vertically as many select options as they are.

Thank you

---

<div class="post-metadata">

**Author:** ![imsingh](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/imsingh/32/7858_2.png) [@imsingh](https://community.dynatrace.com/u/imsingh)\
**Post date:** [January 13, 2025, 2:48pm UTC](https://community.dynatrace.com/t/dynatrace-sdk-datatable-css-row-hover/49600/10 "2025-01-13T14:48:29Z")

</div>

Hi&nbsp;[@chris\_cho](https://community.dynatrace.com/user/84142)

You can still change the height of the DataTableV2. You just have to wrap it around a component that accepts height.

In your case, easiest would be to do something like this:

\<Flex height={200}\>\<DataTableV2\>\</DataTableV2\>\</Flex\>

I hope that helps.

---

<div class="post-metadata">

**Author:** ![chris\_cho](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chris_cho/32/23527_2.png) [@chris\_cho](https://community.dynatrace.com/u/chris_cho)\
**Post date:** [January 13, 2025, 3:07pm UTC](https://community.dynatrace.com/t/dynatrace-sdk-datatable-css-row-hover/49600/11 "2025-01-13T15:07:57Z")

</div>

Hello&nbsp;[@imsingh](https://community.dynatrace.com/user/52863),  
This is not the same as having the initial property _ **height** _ available for DataTableV2

**The header of the table should remain static** , when it scrolls up and down, as it does for initial&nbsp; **DataTable** control,&nbsp;as I specified earlier in this chat.

 ![chris_cho_0-1736780934856.png](https://global.discourse-cdn.com/dynatrace/original/3X/6/4/648403e74631f6eecd1d2d7145d1242554572625.png)

Anyway, for now, I will keep using DataTable, and perhaps in the next releases the DataTableV2 will have some enhancements to include all features from DataTable, and also will be included in the documentation.

Thank you.

---

<div class="post-metadata">

**Author:** ![imsingh](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/imsingh/32/7858_2.png) [@imsingh](https://community.dynatrace.com/u/imsingh)\
**Post date:** [January 13, 2025, 3:23pm UTC](https://community.dynatrace.com/t/dynatrace-sdk-datatable-css-row-hover/49600/12 "2025-01-13T15:23:49Z")

</div>

Hi&nbsp;[@chris\_cho](https://community.dynatrace.com/user/84142)&nbsp;  
Can you give it a try? I’ve tried it already and it does exactly what you want. It makes the header sticky and provide a scrollbar. You can check the screenshot attached.

 ![Screenshot 2025-01-13 at 16.22.52.png](https://global.discourse-cdn.com/dynatrace/original/2X/2/20cab79837dcefc57a2bc4bafa81c0db5664b5ec.png)

Thanks

---

<div class="post-metadata">

**Author:** ![chris\_cho](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chris_cho/32/23527_2.png) [@chris\_cho](https://community.dynatrace.com/u/chris_cho)\
**Post date:** [January 13, 2025, 4:43pm UTC](https://community.dynatrace.com/t/dynatrace-sdk-datatable-css-row-hover/49600/13 "2025-01-13T16:43:59Z")

</div>

Than you&nbsp;[@imsingh](https://community.dynatrace.com/user/52863)
