title: How to apply text fade in hover effect to image in a table?
body: <p>I'm trying to add a text fade in effect when hovering over images in a table. I've gotten it to work with the image on its own, but when I try to apply it to the table element it doesn't work. Nothing happens when I hover over the image. I feel like I am arranging something wrong. Is it not possible to do in a table?</p>
  
  <p>Here's the code:</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>table {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    border-spacing: 50px;
    border-collapse: separate;
  }
  
  td {
    max-width: 150px;
    max-height: 150px;
    text-align: center;
  }
  
  .overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    width: 100%;
    opacity: 0;
    transition: .5s ease;
    background-color: #008CBA;
  }
  
  .container:hover .overlay {
    opacity: 1;
  }
  
  .text {
    color: black;
    font-size: 20px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    -ms-transform: translate(-50%, -50%);
    text-align: center;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;table&gt;
    &lt;tr&gt;
      &lt;th&gt;Cat 1&lt;/th&gt;
      &lt;th&gt;Cat 2&lt;/th&gt;
      &lt;th&gt;Cat 3&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;div class="container"&gt;
        &lt;td class="cat1"&gt;&lt;img src="https://d17fnq9dkz9hgj.cloudfront.net/uploads/2012/11/91615172-find-a-lump-on-cats-skin-632x475.jpg" height="150px" width="150px"&gt;&lt;/td&gt;
        &lt;div class="overlay"&gt;
          &lt;div class="text"&gt;Overlay Text&lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;td class="cat2"&gt;&lt;img src="https://static1.squarespace.com/static/53a096cce4b00d7644776a0b/562b9546e4b016f977a96bd7/562b975fe4b01024eb5d7267/1445697377179/Shake_11_Lil+Bub.jpg?format=1500w" height="150px" width="150px"&gt;&lt;/td&gt;
      &lt;td class="cat3"&gt;&lt;img src="https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Cat03.jpg/1200px-Cat03.jpg" height="150px" width="150px"&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Fiddle:
  <a href="https://jsfiddle.net/megmun/f7esrn0t/" rel="nofollow noreferrer">https://jsfiddle.net/megmun/f7esrn0t/</a></p>