title: Table td overflow scrolling with vertical align middle
body: <p>I have added a <code>table</code> inside a <code>table</code> <code>td</code>. The inside <code>table</code> <code>td</code> needs to scroll when its contain more text, so I just added a span into it and applied CSS properties for limit the <code>height</code> with <code>overflow-y: auto</code></p>
  
  <p>The problem is: <strong>How can I align text vertically middle in inside table td?</strong></p>
  
  <p>or Need to apply <code>vertical-align: middle;</code> for <strong>"Sub Text"</strong></p>
  
  <p>Here is 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>td {
    text-align: center;
    vertical-align: middle;
    border: 1px solid #ddd;
    border-collapse: collapse;
  }
  
  .tbl-small {
    width: 100%;
  }
  
  .tbl-small td {
    height: 40px;
    overflow: auto;
  }
  
  .tbl-small td span {
    height: 40px;
    width: 100%;
    overflow-y: auto;
    display: block;
    vertical-align: middle;
    text-align: center;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;table width="400px;" cellpadding="0" cellspacing="0"&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td width="25%"&gt;Main text&lt;/td&gt;
        &lt;td width="25%"&gt;
          &lt;table class="tbl-small"  cellpadding="0" cellspacing="0"&gt;
            &lt;tbody&gt;
              &lt;tr&gt;
                &lt;td&gt;&lt;span&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt&lt;/span&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                &lt;td&gt;&lt;span&gt;Sub text&lt;/span&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                &lt;td&gt;&lt;span&gt;Sub text&lt;/span&gt;&lt;/td&gt;
              &lt;/tr&gt;
            &lt;/tbody&gt;
          &lt;/table&gt;
        &lt;/td&gt;
        &lt;td width="25%"&gt;
          &lt;table class="tbl-small"  cellpadding="0" cellspacing="0"&gt;
            &lt;tbody&gt;
              &lt;tr&gt;
                &lt;td&gt;&lt;span&gt;Sub text&lt;/span&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                &lt;td&gt;&lt;span&gt;Sub text&lt;/span&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                &lt;td&gt;&lt;span&gt;Sub text&lt;/span&gt;&lt;/td&gt;
              &lt;/tr&gt;
            &lt;/tbody&gt;
          &lt;/table&gt;
        &lt;/td&gt;
        &lt;td width="25%"&gt;Main text&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><strong>JSFiddle:</strong> <a href="https://jsfiddle.net/vishnuprasadps/5684aupk/" rel="nofollow noreferrer">https://jsfiddle.net/vishnuprasadps/5684aupk/</a></p>