Edit: Updated the code slightly based on your comments.
Edit 2: Live example: lachniet.com/chessboard
I'm trying to use a combination of HTML, CSS, and JS to draw out an empty chessboard. My code with CSS and JS inline is this:
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>TitaniumChess</title>
<style>
html,body {
margin: 0;
padding: 0;
}
#board {
border: 1px solid #000;
border-collapse: collapse;
float: left;
height: 50vw;
width: 50vw;
}
.tile-white {
height: 12.5%;
width: 12.5%;
}
.tile-black {
background-color: #000;
color: #fff;
height: 12.5%;
width: 12.5%;
}
</style>
</head>
<body>
<table id="board"></table>
<script>
var board = document.getElementById('board');
var draw = '';
var letters = 'abcdefgh';
for (var column = 8; column > 0; column--) {
draw += '<tr id="' + column + '">';
for (var row = 0; row < 8; row++) {
draw += '<td id="' + letters.charAt(row) + column + '" class="';
if ((row + column) % 2 == 1) {
draw += 'tile-black';
} else {
draw += 'tile-white';
}
draw += '">test</td>';
}
draw += '</tr>';
}
board.innerHTML = draw;
</script>
</body>
</html>
Now, this code works perfectly fine for me in Chrome 52. However, in Firefox 47, the bottom row is cut off. Surprisingly, this code works fine even in IE 11, and Edge 12 (All on Windows 10 Enterprise 64-Bit).
This seems to be a problem specific to Firefox. Does anyone have any idea why?