title: Layer multiple images in one html table cell
body: <p>I have a simple HTML table with a grid of images. But now I'd like one cell to be able to contain multiple layered images as some of them are partially transparent. Making all of the images <code>position: absolute</code> makes the whole table combine into one square though.<br>
  This the structure I have now; In this example, the stone images should be on the sand images that are now (wrongly) above them. (And the coin image should be on the stone image)</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.field {
    border: none;
    border-spacing: 0px;
  }
  
  .field tr, .field td {
    border: none;
    padding: 0px;
    vertical-align: top;
  }
  
  .field img {
    display: block;
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;table class="field"&gt;
    &lt;tr&gt;
      &lt;td&gt;
        &lt;img src="https://image.ibb.co/hTXDA8/land.png"&gt;
      &lt;/td&gt;
      &lt;td&gt;
        &lt;img src="https://image.ibb.co/hTXDA8/land.png"&gt;
        &lt;img src="https://image.ibb.co/hgT9iT/rock_1.png"&gt;
      &lt;/td&gt;
      &lt;td&gt;
        &lt;img src="https://image.ibb.co/hTXDA8/land.png"&gt;
        &lt;img src="https://image.ibb.co/hgT9iT/rock_1.png"&gt;
        &lt;img src="https://image.ibb.co/eFMUiT/coin.png"&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;
        &lt;img src="https://image.ibb.co/hTXDA8/land.png"&gt;
      &lt;/td&gt;
      &lt;td&gt;
        &lt;img src="https://image.ibb.co/hTXDA8/land.png"&gt;
        &lt;img src="https://image.ibb.co/hgT9iT/rock_1.png"&gt;
      &lt;/td&gt;
      &lt;td&gt;
        &lt;img src="https://image.ibb.co/hTXDA8/land.png"&gt;
        &lt;img src="https://image.ibb.co/hgT9iT/rock_1.png"&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>This question <a href="https://stackoverflow.com/questions/5184089/layering-images-inside-a-table-cell?utm_medium=organic&amp;utm_source=google_rich_qa&amp;utm_campaign=google_rich_qa">Layering images inside a table-cell</a> is similar but isn't quite the same and didn't get any satisfactory answers for this problem.  </p>
  
  <p><strong>Clarification:</strong>
  If I simply set the enclosing elements of the images to <code>position: relative</code> and the images to <code>position: absolute</code> all the images end up in the top left corner of the screen. I have a grid of many cells of which each may have multiple layered images!</p>