inline-block causes the element to flows on the page in the same way inline elements do, e.g. text, img elements, etc. In many ways thing of the element as a next text character in a line of test, it will be handled in the same way.
- Element expands as needed to fit the available text, using min-width and max-width as desired.
margin: auto; will not work with an inline-block.
You need to set the text alignment of the containing element to set the inline-block element alignment within it, e.g.
$HtmlOutput .= '<div style="text-align:center;"><a class="MyButton" href="/something.php">MY BUTTON TEXT</a></div>