title: center table in HTML
body: <p>How can I center the <code>table</code> within a <code>div</code> using html?</p>
  
  <p>I have placed my content within a <code>div</code> tag and set the <code>text-align</code> attribute to <code>center</code> like the following.</p>
  
  <pre><code>text-align: center;
  </code></pre>
  
  <p>This has not worked.</p>
  
  <p>Below is my html.</p>
  
  <pre><code>&lt;html&gt;
      &lt;body&gt;
          &lt;div style="text-align:center"&gt;
              &lt;p&gt;
      text test
              &lt;/p&gt;
              &lt;table border="1"&gt;
                  &lt;tr&gt;
                      &lt;td&gt;100&lt;/td&gt;
                      &lt;td&gt;200&lt;/td&gt;
                      &lt;td&gt;300&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td&gt;400&lt;/td&gt;
                      &lt;td&gt;500&lt;/td&gt;
                      &lt;td&gt;600&lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/table&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>