Like samplebias answer, again if Javascript is an acceptable answer, I made a jQuery plugin specifically for this purpose: https://github.com/marcogrcr/jquery-tableoverflow
To use the plugin just type
$('selector').tableoverflow();
Full example: http://jsfiddle.net/Cw7TD/3/embedded/result/
Edits: