Products

Back to Examples

Embed images into your spreadsheet

The following examples shows how to embed images into your spreadsheet.

Load a local image to your table

Load images from your local machine into your javascript spreadsheet

<html>
<script src="https://bossanova.uk/jspreadsheet/v3/jexcel.js"></script>
<script src="https://jsuites.net/v3/jsuites.js"></script>
<link rel="stylesheet" href="https://bossanova.uk/jspreadsheet/v3/jexcel.css" type="text/css" />
<link rel="stylesheet" href="https://jsuites.net/v3/jsuites.css" type="text/css" />

<div id="spreadsheet1"></div>

<script>
let data = [
    ['Purple', 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMTEhUSEhMVFhUXGBUWGBcYFRgYFhUVFxcYGhsYFRgYHSggGholGxoXITEiJSkrLi4uGB8zODMsNygtLisBCgoKDg0OGhAQGi0fHyUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLf/AABEIALcBFAMBIgACEQEDEQH/xAAcAAEAAgMBAQEAAAAAAAAAAAAABAUDBgcCAQj/xAA+EAABAwIDBQQJAQYGAwAAAAABAAIRAyEEBTESQVFhcQYigZEHEzKhscHR4fBSQmKSosLxFCMkQ1NyFjOC/8QAGQEBAQEBAQEAAAAAAAAAAAAAAAIDAQQF/8QAIxEBAQEBAAICAwACAwAAAAAAAAECEQMhEjETQVEEcRQiMv/aAAwDAQACEQMRAD8A7iiIgIiICIiAiIgIiICIiAiIgIvD6rRqQOpAXgYun+tn8QQZkXljwdCD0K9ICIiAiIgIiICIiAiIgIiICIiAiIgIiICIiAiIgIiICIiAiLFicQ1jS55gBBlULGZnTp+06TwFytYzrtYLhrtlvW58Voecdr2izTPT6quf1pnx2ug5h2w2fZAHvK1fMe2rzq8+B+S51jM+e86qtqY4nf5rs41/HI3mt2qJ3kqL/wCTH9RC0o1L81kg7iVXXPTe6HauowyHX5H7rZcm9JUENrXGk7/NcqpUzFzdSKdNd51NkfpDK81pYhu1ScDxE3Cmr895NmVXDvD6biIj+3Rde7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vRzhv0H+N31UvFZP6qmxrRZoDRqbDQX8vBbs9qh4qkHAgixXZeHa5jisKQSfhw/DKrsQyAb8Tz5Las6wrqTiYkceX1Wp4hpBJ+51K3mov7VtVocNI1ueJ1UZ9EBt+cDep9e8c/iLqPVaYMk8uXuVOtfxmHv8FAqUleVBw3nfu8fNRatEErPWetJpWFkr62laVOGHheGUdyj4r+SPTplWWU1gwkOuHWjdGlwo76ZOi+MbF12TlLZYnjJqMh7COhMx0BUfFOEwLAbl4Y8qRQwm2ZK0upzknGfL3tvVhkuGEgru/ZPBepwzGkQ53fd1doPAQucdicnD3hzm9xkE8zub9eXVdPp11jr+M/JrvpZBy+gqIyqsrXqWbPK+rGHL2EH1ERAREQEREBERAREQEREBfF9RB5hfCF6RBhc1R6lNTSF5cxBSYzCBwIcJC0/Nch2ZIuOPyK6K+iodfByuy8dl45DXwgAPd+1teih4imNmIMm09V0fNOzzXSQIN9Ba/ELV8dkVRkw3aHL6Fa53FdlajiKYj5KurvAGmtvEK3xmHcCQWuadLiPcVWV6RJPAWP11V2rkQbi/3COcd11ka06Rb7bl6e4TBH5zXJHbWAVjItCytAi69vYBwUzCZZUqR6um484gEdTZd5z7c6iU6Yn8utj7PZM6qRHdbvdHuE6lWGT9jHEh1W5/SNPE/Rb1l+U7IAAgDQAWCz1ufpN3/HrAUW02BjBDR+SeasqRK9UcEplPCrJm801IYvbKCytpoPjAsgQBekBERAREQEREBERAREQEREBERAREQEREHyF8LV6RBidSCw1ME06hS0QVNbI6btWhVmI7E4Z+tNv8IHwW0og0ip6OMIf9v+Zw+BXmn6NsGL+qHiXH4lbyi72u9rVsL2Kw1P2aTBzDRPmrOlklMblbIuOIbMC0aBZm0AsyIPAphetlfUQfIX1EQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERB//2Q=='],
];

jexcel(document.getElementById('spreadsheet1'), {
    data:data,
    minDimensions: [2,4],
    columns: [
        { type:'text', width:300, title:'Title' },
        { type:'image', width:120, title:'Cover' },

     ]
});
</script>
</html>

Embed remote images to your table

Automatic image rendering from a remote URL using updateTable method

<html>
<script src="https://bossanova.uk/jspreadsheet/v3/jexcel.js"></script>
<script src="https://jsuites.net/v3/jsuites.js"></script>
<link rel="stylesheet" href="https://bossanova.uk/jspreadsheet/v3/jexcel.css" type="text/css" />
<link rel="stylesheet" href="https://jsuites.net/v3/jsuites.css" type="text/css" />

<div id="spreadsheet2"></div>

<script>
jexcel(document.getElementById('spreadsheet2'), {
    data: [
        ['https://marketplace.canva.com/MACcZp2p4po/2/0/thumbnail_large/canva-black-white-acoustic-album-cover-MACcZp2p4po.jpg', 'Paul Parker'],
        ['https://marketplace.canva.com/MACcY55adP4/1/0/thumbnail_large/canva-black-and-white-masculine-acoustic-modern-album-cover-MACcY55adP4.jpg', 'Mark Ellen']
    ],
    columns: [
        { type:'text', width:300, title:'Cover' },
        { type:'text', width:300, title:'Title' },
    ],
    updateTable: function (instance, cell, col, row, val, id) {
        if (col == 0) {
            cell.innerHTML = '<img src="' + val + '" style="width:100px;height:100px">';
        }
    }
});
</script>
</html>