Skip to content

How to center the grid

To horizontally center a grid, you can place the grid inside a DIV given the following CSS

<div id="center-me">
  <?php
  $dg = new C_DataGrid("SELECT * FROM orders", "orderNumber", "orders");
  $dg -> display();
  ?>
</div>

<style>
#center-me {
  display: table;
  margin: 0 auto;
}
</style>

Feedback and Knowledge Base