Izan
Izan

Reputation: 5

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

Upvotes: 0

Views: 683

Answers (1)

Trevor Clarke
Trevor Clarke

Reputation: 1478

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

img.border = "5";

Hope this helps

Upvotes: 1

Related Questions