title: How do I horizontally center a table in Bootstrap
body: <p>This my code. What I'm trying to do is to get this table at the center of the container. But instead, it aligns to the left by default when I use the &quot;container&quot; class, and it uses the full width when I use the &quot;container-fluid class&quot; for the div. I want to horizontally center the table. Can anyone help?</p>
  <pre><code>&lt;!-- Container (Pricing Section) --&gt;
  &lt;div id=&quot;pricing&quot; class=&quot;container-fluid&quot;&gt;
  &lt;table class=&quot;table table-bordered table-striped&quot;&gt;
  &lt;thead&gt;&lt;tr&gt;
  &lt;th&gt;Material Name&lt;/th&gt;
  &lt;th&gt;Rate (INR)&lt;/th&gt;
  &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody style=&quot;&quot;&gt;
  &lt;tr&gt;
  &lt;td&gt;Books&lt;/td&gt;
  &lt;td&gt;7.00(per KG)&lt;/td&gt;
  
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;Soft Plastic&lt;/td&gt;
  &lt;td&gt;15.00(per KG)&lt;/td&gt;
  
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;Hard Plastic&lt;/td&gt;
  &lt;td&gt;2.00(per KG)&lt;/td&gt;
  
  &lt;/tr&gt;
  &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;div&gt;
  </code></pre>
  <p>Here is a screenshot.</p>
  <p><img src="https://i.stack.imgur.com/oQsn5.png" alt="Screenshot" /></p>
  <p>I know &quot;container-fluid&quot; uses the full width, but I have also used &quot;container&quot; class only and it does not help. Please advise.</p>