HTML/CSS center for all resolutions without % (percentage)
<p>I was wondering, is it possible to make this central box be "in the very" center of the page without using %?</p>

<p>I'm using VPS and I have some Python going on there, so I don't know how to use % sizes in order to get it right. But this is how far I came up only to hear that this isn't centered on 1280x1024:</p>

<p><a href="https://s18.postimg.org/vta0qfd5l/2809583a0f43627d0fc1b428863b3faa.jpg" rel="nofollow">https://s18.postimg.org/vta0qfd5l/2809583a0f43627d0fc1b428863b3faa.jpg</a></p>

<p>This is the code I have used:</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>h2 {
  margin: 0;
}
body {
  background-color: #121212;
  background-image: url("https://app.box.com/shared/static/vgfs65li424fk8h4n5e23pm7070yrewq.jpg");
  background-size: contain;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-position: center;
  background-height: auto;
  max width: 1200px;
}
table {
  display: inline-block;
  position: absolute;
  max-width: 350px;
  max-height: 265px;
  border: 5px ridge yellow;
  top: 0;
  bottom: 0;
  margin: auto;
  left: 0;
  right: 0;
  padding-left: 90px;
  padding-right: 90px;
  background: rgba(255, 255, 255, 0.8);
}
div {
  text-align: center;
  align: center;
}</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div&gt;
  &lt;table&gt;

  &lt;/table&gt;
&lt;/div&gt;</code></pre>
</div>
</div>
</p>

<p>So, any idea what I can improve to "nail it"? I've noticed that if I add more to max-width complete box moves to the left. Maybe if I can solve this, I would solve the first problem as well?</p>

<p>This question is unique because I can't use percentage in order to align table properly, so I just want to know if this is possible at all.</p>

<p>Thanks!</p>

<p>You can position it using absolute positions in CSS and measurements in px.  If you are using Jquery then you can get the document sizes using</p>

<pre><code>$(document).height();
$(document).width();
</code></pre>

<p>or 
   $(window).height(); // for the viewport.</p>

<p>Some quick JavaScript calculations should allow you to dynamically position something anywhere you want.
Don't forget to bind .resize() events to adapt to user adjusting browser size.
Heres a nice article on getting window sizes etc.</p>

<p><a href="https://andylangton.co.uk/blog/development/get-viewportwindow-size-width-and-height-javascript" rel="nofollow">https://andylangton.co.uk/blog/development/get-viewportwindow-size-width-and-height-javascript</a></p>

python html css center