当前位置: 动力学知识库 > 问答 > 编程问答 >

Jqgrid: Resize to fit image in the grid

问题描述:

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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: