JS gets the actual width and height of the image, and adapts it according to the image size
function adapt(){
var tableWidth = $("#imgTable").width(); / /Table width
var img = new Image();
img.src =$('#imgs').attr("src");
var imgWidth = img.width; //actual image Width
if(imgWidth
$('#imgs').attr("style","width: auto");
}else{
$('#imgs' ).attr("style","width: 100%");
}
}
You can also set the CSS style: