You can add more than one transform, and they can be of the same function:
@keyframes scroll {
0% {
transform:translateX(0%);
}
100% {
transform:translateX(10px) translateX(-100%);
}
}
Will set the remaining space to 10px
You can do what you want (translate the span until the right border adjusts to the container div border) using a wrapper (another one).
I have created a simple demo so that you can see the technique.
For this HTML
<table>
<tr>
<td>aaaaaaaaaa</td>
<td><div><span>aaaaaaaaaa bbbbbb ccccc dddddd</span></div></td>
<td>aaaaaaaaaa</td>
</tr>
<tr>
<td>aaaaaaaaaa</td>
<td><div><span>aaaaaaaaaa bbbbbb ccccc dddddd eee fff ggg hhh jjjjj j</span></div></td>
<td>aaaaaaaaaa</td>
</tr>
</table>
The CSS is
table {
width: 356px;
table-layout:fixed;
}
td {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
border:1px solid black;
padding:5px;
position: relative;
}
div {
border: solid 1px red;
width: 100%;
transition: all 2s;
}
span {
display: inline-block;
background-color: rgba(160,255,200,0.4);
transition: all 2s;
}
td:hover div {
-webkit-transform: translateX(100%);
}
td:hover span {
-webkit-transform: translateX(-100%);
}
The first wrapper (the div) is set to 100% width. translating it to 100% sets its left border to the right of the parent. Now, translating the span -100%, moves the right border to the left border of the div, and so to the right border of the td.
The div and the span have colored border and background so that the effect is visible.