My suggestion is having the tiles absolutely positioned inside the board, to save on HTML (transfer time) and position calculations (load time) by the browser. JS to register the clicks and handle it (less HTML = less transfer and load time).
So, you could have this base CSS:
#board {
display: block;
width: [BoardWidth]px; /* TileWidth * NumberOrColumns */
height: [BoardHeight]px; /* TileHeight * NumberOfRows */
position: relative;
}
.tile {
display: block;
width: [TileWidth]px;
height: [TileHeight]px;
float: left;
}
Then having the html generated like that:
<div id="board">
<div class="tile" style="position: absolute; left:0px; top:0px;"></div>
<div class="tile" style="position: absolute; left:20px; top:0px;"></div>
<div class="tile" style="position: absolute; left:40px; top:0px;"></div>
<div class="tile" style="position: absolute; left:60px; top:0px;"></div>
<div class="tile" style="position: absolute; left:0px; top:20px;"></div>
<div class="tile" style="position: absolute; left:20px; top:20px;"></div>
<div class="tile" style="position: absolute; left:40px; top:20px;"></div>
<div class="tile" style="position: absolute; left:60px; top:20px;"></div>
<div class="tile" style="position: absolute; left:0px; top:40px;"></div>
<!--(...)-->
</div>
In which every tile has position left: [X*TileWidth]px; top: [Y*TileHeight]px;
.
That, or David M's suggestion.
You can also cut on page load time if you make the page size smaller - so, like suggested, using JQuery or another JavaScript framework to create the trigger for the click on each div
would be ideal.
I'm not very savvy, but using JQuery it would be something like:
$(document).ready(function() {
$(".tile").click(function() {
// find out which square was clicked, and perhaps redirect to a page with get variables
});
});