简体   繁体   中英

How to add space between two images?

How to add space between two images in same cell in JavaScript? Below is the code, I want to add space between download and delete button.

var cell = row.insertCell();
var img = document.createElement('img');
img.src = '/ock/images/oess_images/item_download16.png';
img.alt = "Download document";
img.border = "0";
img.style.cursor = "pointer";
img.longDesc = "location.href='/download.php?docid=" + jsonData.suppdocs[i].docid + "'";
img.onclick = function () {
    eval(this.longDesc)
};
cell.appendChild(img);
cell.align = "left";
cell.className = "field";
if (document.mainform.candeletedoc.value == 1) {
    var img = document.createElement('img');
    img.src = '/ock/images/oess_images/item_delete16.png';
    img.alt = "Delete document";
    img.border = "0";
    img.style.cursor = "pointer";
    img.longDesc = "deleteDocument(" + jsonData.suppdocs[i].docid + ")";
    img.onclick = function () {
        eval(this.longDesc)
    };
    cell.appendChild(img);
    cell.align = "center";
    cell.className = "field";
} //end if

Try adding a margin to one of the photos. Or make the boarder larger.

img.border = "5";

Hope this helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM