I am using jqxgrid to create a grid and added a title to some span texts inside cells. But now I want to style these titles which is not possible as I know. So I tried to add tooltips, but tooltips are not shown properly. This is the css code
.title-styled[title]:hover:after {
content: attr(title);
color: #333;
position: absolute;
left: 0;
top: 100%;
white-space: nowrap;
z-index: 2147483647 !important;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-box-shadow: 0px 0px 4px #222;
-webkit-box-shadow: 0px 0px 4px #222;
box-shadow: 0px 0px 4px #222;
background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #eeeeee),color-stop(1, #cccccc));
background-image: -webkit-linear-gradient(top, #eeeeee, #cccccc);
background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);
background-image: -ms-linear-gradient(top, #eeeeee, #cccccc);
background-image: -o-linear-gradient(top, #eeeeee, #cccccc);
}
span:
...
else {
return '<br> <span class="title-styled" title="Road:' + record.Quantity + '">' + value;
}
...

You need to clarify more about the issue. What's your expected result? Explain what do you mean by "but tooltips are not shown properly" & "this shadow belongs to tooltip but it is shown under other cell". Provide the whole jqxgrid code for how you setup or a functional test case in jsfiddle are strongly recommended.
I can't see any tooltip output in your question. I assume your issue is simply tooltips not displaying. I suggest you use
cellhoveraction to triggerjqxTooltip.jqxTooltip's contentaccept html code as input you can add your css style into it.Example: https://jsfiddle.net/c40e3n6p/ (You need to modify it to fit your case!)
html code:
css code:
JavaScript + jQuery code: