问题描述:

I have an image in a grid. I would like the image to resize to fit into the grid column, and to be horizontally and vertically centered.

My jqgrid looks like:

name: "frontimageurl", sortable: false, width: 100, height: 50, align: "center", fixed: true,

formatter: function (cellvalue, options, rowobject) {

return "<img src='" + cellvalue + "'>";

My image looks like overlapping of image.

Kindly help me to acheive this.Thanks in advance.

网友答案:

I added a class,

"<img src='" + cellvalue + "' class= Image>";

CSS:

 .Image
{
width: 300px;
height: 100px;
margin: 5px 10px 0px 0px;
}

This works perfect for me.

相关阅读:
Top