ComponentOne Preview Classic for WinForms: Preview Classic for WinForms Task-Based Help > Centering a Table on the Page

Centering a Table on the Page

To center a table on the page, set the AlignInParentHorz property to Center. Add the following code to the Form_Load event:

      Visual Basic

Dim table As C1.C1PrintDocument.RenderTable = New C1.C1PrintDocument.RenderTable(Me.C1PrintDocument1)

table.Style.AlignInParentHorz = C1.C1PrintDocument.AlignInParentHorzEnum.Center

      C#

C1.C1PrintDocument.RenderTable table = new C1.C1PrintDocument.RenderTable(this.c1PrintDocument1);

table.Style.AlignInParentHorz = C1.C1PrintDocument.AlignInParentHorzEnum.Center;

This topic illustrates the following:

Your C1PrintDocument should appear similar to the image below, with the table centered on the page.

 


Send comments about this topic to ComponentOne.
Copyright © 1987-2010 ComponentOne LLC. All rights reserved.