title: Make td element same width as input element with only using css/scss?
body: <p>I have tried to ask this question before without any luck so I'll try to ask it again. I really hope someone can help. </p>
  
  <p>What I want is: </p>
  
  <ul>
  <li>the table to stretch to 100%</li>
  <li>the first input element to "fill" the table since the table has to be 100%</li>
  <li>the other input elements to be in different sizes </li>
  <li>the td to be the same width as the input elements (no space)</li>
  <li>to achieve this with only changing the css (no js, no html changes)</li>
  </ul>
  
  <p>In the code snippet below you can see my html table. I do not want to change it in any way, and I don't want to add any classes. I don't want to use any javascript either. </p>
  
  <p>If you run the code snippet you can see my problem. The td's are much wider than the input element. I want the second, third and forth td to "shrink" to the size of the input element. I want the first td to strech out (since the table has to be 100%). </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 {
    width: 100%;
    border-collapse: collapse;
  }
  
  td {
    border: 1px solid #000;
  }
  
  .small {
    width: 20px;
  }
  
  .medium {
    width: 40px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;table&gt;
  &lt;tbody&gt;
    &lt;td&gt;
      &lt;div&gt;
        &lt;input type="text" /&gt; 
      &lt;/div&gt;
    &lt;/td&gt;
    &lt;td&gt;
      &lt;div&gt;
        &lt;input class="small" type="text" /&gt; 
      &lt;/div&gt;
    &lt;/td&gt;
    &lt;td&gt;
      &lt;div&gt;
        &lt;input class="medium" type="text" /&gt; 
      &lt;/div&gt;
    &lt;/td&gt;
    &lt;td&gt;
      &lt;div&gt;
        &lt;input class="medium" type="text" /&gt; 
      &lt;/div&gt;
    &lt;/td&gt;
  &lt;/tbody&gt;
  &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I know this can be solved by setting the width on the td elements insteadof the input, but that is not what I am asking for. I also know it can be solved by setting the width of the table to auto, but that is not what I want either. I just want the td elements to be the same width as the input elements with using css only. </p>