Is it possible to position an element within a container that contains a wide table with overflow property so that the element remains visible while scrolling horizontally through the table data?
<div id = "mainContainer" style = "width:300px; overflow-x:auto">
<div id = "floatingContainer" style = "border: 1px solid #ccc">Stay in the middle</div>
<table>
<tr>
<td>0</td>
<td>0</td>
<td>0</td>
// additional code removed for brevity
</tr>
</table>
</div>
Can this be achieved using CSS alone or is jQuery required? Perhaps utilizing position: fixed relative to the containing div...