Repository navigation
Can't figure out how to add shadows to table rows #20588
Unanswered
enyichiaagu
asked this question in
Help
Replies: 2 comments
|
When applying the shadow, have the row be above in the z stack order: .orders tr:hover {
box-shadow: 0 2px 8px rgb(0 0 0 / 0.82);
+ position: relative;
+ z-index: 1;
} |
0 replies
|
Hi @community! By default in CSS, HTML tables collapse borders and table rows ( Method 1: Relative Stacking on Hover (Recommended)Give the <table class="border-separate border-spacing-0 w-full">
<tr class="hover:relative hover:z-10 hover:shadow-lg transition-shadow">
<td class="p-4 bg-white">Column 1</td>
<td class="p-4 bg-white">Column 2</td>
</tr>
</table>Key rule: The Method 2: Cell-Level Shadows with Rounded EdgesIf you want each row to look like a floating card: <tr class="group">
<td class="bg-white p-4 group-hover:shadow-md first:rounded-l-lg last:rounded-r-lg">...</td>
</tr> |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Here is the Tailwind Play. I will like the shadows to show whenever I hover on table rows. Right now other rows are blocking the shadows and only the last one behaves the way I want the rest to. Thanks for the response.
All reactions