# How to display a table in the center of the screen?

**URL:** <https://forum.kirupa.com/t/how-to-display-a-table-in-the-center-of-the-screen/108976>\
**Category:** Uncategorized\
**Created:** [April 30, 2004, 11:38am UTC](https://forum.kirupa.com/t/how-to-display-a-table-in-the-center-of-the-screen/108976 "2004-04-30T11:38:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hellion](https://avatars.discourse-cdn.com/v4/letter/h/6a8cbe/32.png) [@Hellion](https://forum.kirupa.com/u/Hellion)\
**Post date:** [April 30, 2004, 11:38am UTC](https://forum.kirupa.com/t/how-to-display-a-table-in-the-center-of-the-screen/108976/1 "2004-04-30T11:38:22Z")

</div>

[color=#000080]Hi. Im looking for the script to center a main table in the screen regardless of the resolution. I remember reading about it in here but cant seem to find the thread anymore. I need to know also how and where to insert the code.[/color]

[color=#000080]I know the code goes something like this:[/color]  
[color=#000080][/color]  
[color=#000080]// Set the new x/y values for the window  
// This will move the window to the center of the screen  
new\_x = ((screen.availWidth / 2)- (width / 2));  
new\_y = ((screen.availHeight / 2) - (height / 2))

```
    // Resize the window and move it to the center of the screen
    window.resizeTo(width,height);
    window.moveTo(new_x,new_y);

```

[/color]
