Image to Table Converter
How do I make an image to table converter?
This handy-dandy Dan-Denney-demands-it tool converts an image into an HTML table.. What is a image to table converter? How do you make a image to table converter? This script and codes were developed by Ilya Pestov on 23 August 2022, Tuesday.
Image to Table Converter - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Image to Table Converter</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <form class='form bcddr group pam tci'> <div class='form-field fl'> <label class='form-label' for='file'>Image File:</label> <input class='js-file' type='file'> </div> <div class='form-field fr'> <label class='form-label' for='size'>Size</label> <input class='form-input form-input--number' id='size' max='20' min='1' type='number' value='1'> px </div>
</form>
<div class='row'> <div class='cell'> <div class='js-output'> <h1>Image to Table Converter</h1> <p>This handy-dandy Dan-Denney-demands-it tool converts an image into an HTML table.</p> <h2>How to Use</h2> <ul> <li>Choose a table cell size</li> <li>Choose an image file</li> </ul> <p>Any images larger than 256x256 have a pretty good chance of slowing down your browser and/or crashing it. Don't say I didn't warn you!</p> </div> </div>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Image to Table Converter - Script Codes CSS Codes
*, ::before, ::after { box-sizing: border-box;
}
html { color: #323232; font-family: "Helvetica Neue", "Helvetica", "Arial", sans-serif; line-height: 1.5;
}
body { margin: 0;
}
h1, h2 { margin-top: 0;
}
.cell { margin-left: auto; margin-right: auto; max-width: 40em; position: relative;
}
.form { margin-bottom: 1.25em;
}
.form-field { display: inline-block;
}
.form-input { border: 0; color: #323232; font-size: 100%; padding: 0.3125em 0;
}
.form-input--number { text-align: right;
}
.form-label { font-weight: bold;
}
.row { overflow: hidden; padding: 0 1.25em;
}
.controls { background-color: #b51f24; color: #fff; padding: 1.25em;
}
.group::after { clear: both; content: ""; display: table;
}
.fl { float: left;
}
.fr { float: right;
}
.bcddr { background-color: #b51f24;
}
.mhc { margin-left: auto; margin-right: auto;
}
.mbm { margin-bottom: 1.25em;
}
.pam { padding: 1.25em;
}
.tci { color: #fff;
}
.w100 { width: 100%;
}
Image to Table Converter - Script Codes JS Codes
(function() { var file, handleImage, hexConvert; hexConvert = function(color) { var hex; hex = color.toString(16); if (hex.length === 2) { return hex; } else { return "#" + hex; } }; file = $('.js-file'); handleImage = function(e) { var reader; reader = new FileReader(); reader.onload = function(event) { var img; img = new Image(); img.onload = function() { var a, b, bgcolor, bitmap, canvas, ctx, g, i, j, k, r, ref, ref1, rgba, size, str, x, y; canvas = document.createElement('canvas'); canvas.width = img.width; canvas.height = img.height; ctx = canvas.getContext('2d'); ctx.drawImage(img, 0, 0); bitmap = ctx.getImageData(0, 0, img.width, img.height).data; size = $('#size').val(); str = "<table class='mbm mhc' border='0' cellpadding='0' cellspacing='0'>"; i = 0; for (y = j = 0, ref = canvas.height; 0 <= ref ? j < ref : j > ref; y = 0 <= ref ? ++j : --j) { str += '<tr>'; for (x = k = 0, ref1 = canvas.width; 0 <= ref1 ? k < ref1 : k > ref1; x = 0 <= ref1 ? ++k : --k) { r = bitmap[i]; g = bitmap[i + 1]; b = bitmap[i + 2]; a = bitmap[i + 3] / 255; if (a === 1) { r = hexConvert(r); g = hexConvert(g); b = hexConvert(b); bgcolor = "#" + r + g + b; str += "<td height='" + size + "' width='" + size + "' bgcolor='" + bgcolor + "'></td>"; } else { rgba = "rgba(" + r + ", " + g + ", " + b + ", " + a + ")"; str += "<td height='" + size + "' width='" + size + "' style='background: " + rgba + ";'></td>"; } i += 4; } str += '</tr>'; } str += "</table>"; $('.js-output').html(str); str = str.replace('<', '<').replace('>', '>'); str = "<textarea class='w100' rows='6' readonly>" + str + "</textarea>"; return $('.js-output').append(str); }; return img.src = event.target.result; }; return reader.readAsDataURL(e.target.files[0]); }; file.on('change', handleImage);
}).call(this);
Developer | Ilya Pestov |
Username | Pestov |
Uploaded | August 23, 2022 |
Rating | 3 |
Size | 5,384 Kb |
Views | 20,240 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
A Pen by Ilya Pestov | 2,243 Kb |
CSS Clip and Shape Module clearly | 2,640 Kb |
Finally, normal text gradient | 1,850 Kb |
Wonderful clip-path animation | 2,123 Kb |
CSS Family Tree | 2,298 Kb |
Image to Table Converter | 5,384 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Feedback Page | TessDiNapoli | 2,836 Kb |
Birthday Party Starter | Aussieyang | 1,629 Kb |
DNA Double Helix | Hugo | 5,112 Kb |
Box-sizing | Elad2412 | 1,572 Kb |
Wikipedia Viewer | Odylic | 2,333 Kb |
Animated Donut Chart | Jplhomer | 3,808 Kb |
Flexbox slider | Rendro | 3,459 Kb |
Simple CSS loader. | Cabrera | 2,574 Kb |
SVG Animation | Pollardld | 3,133 Kb |
Haml Calendar | Katydecorah | 5,643 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!