using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Documents; namespace Demos.Warden.TagTextEditing { public class ThreeColumnLayoutTable : Table { public void setLayout() { TableColumn leftColumn = new TableColumn(); TableColumn centerColumn = new TableColumn(); TableColumn rightColumn = new TableColumn(); this.Columns.Add(leftColumn); this.Columns.Add(centerColumn); this.Columns.Add(rightColumn); // Create and add an empty TableRowGroup to hold the table's Rows. this.RowGroups.Add(new TableRowGroup()); this.RowGroups[0].Rows.Add(new TableRow()); Paragraph parLeft = new Paragraph(new Run("VPRAVO")); parLeft.TextAlignment = TextAlignment.Left; Paragraph parCenter = new Paragraph(new Run("STŘED")); parCenter.TextAlignment = TextAlignment.Center; Paragraph parRight = new Paragraph(new Run("VLEVO")); parRight.TextAlignment = TextAlignment.Right; this.RowGroups[0].Rows[0].Cells.Add(new TableCell(parLeft)); this.RowGroups[0].Rows[0].Cells.Add(new TableCell(parCenter)); this.RowGroups[0].Rows[0].Cells.Add(new TableCell(parRight)); } public static void setColumnA4Width(ThreeColumnLayoutTable table) { foreach(TableColumn clmn in table.Columns) { clmn.Width = new GridLength(210); } } public static void setColumnAutoWidth(ThreeColumnLayoutTable table) { foreach (TableColumn clmn in table.Columns) { clmn.Width = GridLength.Auto; } } } }