I set up a demo page with two examples. The first table uses tooltips (hover over the ID) to show the image and the second table uses a modal window (click the ID) to show the image. The page is in this pastebin.
The examples extract the ID from the table cell itself and include it as part of the image filename; but you could potentially add an attribute to the table cell with the full image URL. I made this simple for demo purposes.
Personally, I like the tooltip option which uses this jQuery Tooltip script.
$(document).ready(function(){
// full URL example = http://i50.tinypic.com/9a8spk.jpg
// The ID cell in this example would contain "50.tinypic.com/9a8spk"
var imgPath = 'http://i';
var fileType = '.jpg';
$('table').find('tr').each(function(){
var img = $(this).find('td:eq(0)');
img.tooltip({
bodyHandler: function() {
return $("<img/>").attr("src", imgPath + img.html() + fileType );
},
showURL: true
})
})
})
But if you prefer, modal windows are another option:
$(document).ready(function(){
var windowTitle = 'Image of user ID #';
var windowWidth = 520;
// full URL example = http://i50.tinypic.com/9a8spk.jpg
// The ID cell in this example would contain "50.tinypic.com/9a8spk"
var imgPath = 'http://i';
var fileType = '.jpg';
$('table').find('tr').each(function(){
var img = $(this).find('td:eq(0)');
img.click(function(){
$('#dialog').remove();
$('<div/>')
.attr({ title: windowTitle + $(img).html(), id: 'dialog'})
.html('<img src="' + imgPath + $(img).html() + fileType + '">')
.appendTo('body');
$("#dialog").dialog({ bgiframe: true, width: windowWidth });
})
})
})