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

[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]