Give this a shot,
Initial Approach
Insert position:relative
into tr:hover{...} with z-index:2
.
Additionally, include position:relative
in tr td{...} with z-index:1
.
This will be the result
tr:hover {
box-shadow: 0 0 10px 3px rgba(255, 0, 0, 0.5);
-moz-box-shadow: 0 0 10px 3px rgba(255, 0, 0, 0.5);
-webkit-box-shadow: 0 0 10px 3px rgba(255, 0, 0, 0.5);
position: relative;
z-index:2;
}
tr td{
position: relative;
z-index:1;
}
See it in action
tr:hover {
box-shadow: 0 0 10px 3px rgba(255, 0, 0, 0.5);
-moz-box-shadow: 0 0 10px 3px rgba(255, 0, 0, 0.5);
-webkit-box-shadow: 0 0 10px 3px rgba(255, 0, 0, 0.5);
position: relative;
z-index:2;
}
tr td{
position: relative;
z-index:1;
}
<!DOCTYPE html>
<html>
<head>
<style>
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}
td,
th {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}
tr:hover {
box-shadow: 0 0 10px 3px rgba(255, 0, 0, 0.5);
}
tr:nth-child(even) {
background-color: #dddddd;
}
</style>
</head>
<body>
<h2>HTML Table</h2>
<h4>
Onmouseover on the even row the box shadow is not completely visible
</h4>
<table>
... (Table content here)
</table>
</body>
</html>
Alternative Technique
Utilize box-shadow
as inset
box-shadow: inset 0 0 10px 3px rgba(255, 0, 0, 0.5);
tr:hover {
box-shadow: inset 0 0 10px 3px rgba(255, 0, 0, 0.5);
-moz-box-shadow: inset 0 0 10px 3px rgba(255, 0, 0, 0.5);
-webkit-box-shadow: inset 0 0 10px 3px rgba(255, 0, 0, 0.5);
}
<!DOCTYPE html>
<html>
<head>
<style>
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}
td,
th {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}
tr:nth-child(even) {
background-color: #dddddd;
}
</style>
</head>
<body>
<h2>HTML Table</h2>
<h4>
Onmouseover on the even row the box shadow is not completely visible
</h4>
<table>
... (Table content here)
</table>
</body>
</html>