title: How can I apply a border only inside a table?
body: <p>I am trying to figure out how to add border only inside the table. When I do:</p>
  
  <pre><code>table {
      border: 0;
  }
  table td, table th {
      border: 1px solid black;
  }
  </code></pre>
  
  <p>The border is around the whole table and also between table cells. What I want to achieve is to have border only inside the table around table cells (without outer border around the table).</p>
  
  <p>Here is markup I'm using for tables (even though I think that is not important):</p>
  
  <pre><code>&lt;table&gt;
      &lt;tr&gt;
          &lt;th&gt;Heading 1&lt;/th&gt;
          &lt;th&gt;Heading 2&lt;/th&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Cell (1,1)&lt;/td&gt;
          &lt;td&gt;Cell (1,2)&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Cell (2,1)&lt;/td&gt;
          &lt;td&gt;Cell (2,2)&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Cell (3,1)&lt;/td&gt;
          &lt;td&gt;Cell (3,2)&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>And here are some basic styles I apply to most of my tables:</p>
  
  <pre><code>table {
      border-collapse: collapse;
      border-spacing: 0;
  }
  </code></pre>