title: how to cut table cells to end of text in html
body: <p>I am fairly new to HTML and CSS so am struggling with a cell spacing problem.</p>
  
  <p>I am trying to stop the cell space when the text ends although all my attempts have not worked and online resources have no either. This is my 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>h1 {
    color: blue;
  }
  
  table {
    border-collapse: collapse;
  }
  
  table, th, td {
    text-align: left;
    border: 1px solid black;
    border-spacing: 0;
    padding: 0;
  }
  
  th {
    background-color: skyblue;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;h1&gt;Packing Note&lt;/h1&gt;
  &lt;table style="width:60%" cellspacing="0.2" cellpadding="0.2"&gt;
   &lt;tr&gt;
      &lt;th&gt;Quantity&lt;/th&gt;
      &lt;th&gt;Item Name&lt;/th&gt;
      &lt;th&gt;Sent&lt;/th&gt;
      &lt;th&gt;To Follow&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;X&lt;/td&gt;
      &lt;td&gt;X&lt;/td&gt;
      &lt;td&gt;X&lt;/td&gt;
      &lt;td&gt;X&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I have tried <code>border-collapse</code> which is suggested online which has not worked. I have also tried padding and width which haven't changed it.</p>
  
  <p>Any help would be appreciated.</p>