PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Table Positioning
https://forum.pdfsharp.net/viewtopic.php?f=2&t=1706
Page 1 of 1

Author:  randomBen [ Mon Jun 27, 2011 2:52 pm ]
Post subject:  Table Positioning

I need to create a page footer that has 5 small tables in it. The first 4 tables are all on the same horizontal line in the footer. Each of these 4 tables has 2 rows. I was able to get the 4 tables to work properly and be spaced correctly by using the code below and setting the XX in "XXcm" to the amount I needed to indent for each (the code is a sample of one of the 4 tables).

Once I added my 5th table that needed to be below the first 4 tables I ran into a big issue. The table just sat on top of the other 4 tables. I tried putting the first 4 tables into 1 TextFrame and the 5th into another and that did not solve the problem. In fact, it created a new issue because each of the first 4 tables showed up like set of descending stairs, each table lower than the last, and the 5th table still showed up over top of my first table. How do I fix this?

Code:
footerTable = footerFirstLine.AddTable();
footerTable.Style = "Table";
footerTable.Borders.Color = TableBlackBorder;
footerTable.Borders.Width = 0.25;
footerTable.Rows.LeftIndent = "XXcm";

column = footerTable.AddColumn("5cm");
column.Format.Alignment = ParagraphAlignment.Center;

row = footerTable.AddRow();
row.HeadingFormat = true;
row.Format.Alignment = ParagraphAlignment.Center;
row.Cells[0].AddParagraph(" Quotation #:");
row.Cells[0].Format.Alignment = ParagraphAlignment.Center;
row.Cells[0].VerticalAlignment = MigraDoc.DocumentObjectModel.Tables.VerticalAlignment.Center;

row = footerTable.AddRow();
row.HeadingFormat = true;
row.Format.Alignment = ParagraphAlignment.Center;
row.Cells[0].AddParagraph("E######");
row.Cells[0].Format.Alignment = ParagraphAlignment.Center;
row.Cells[0].VerticalAlignment = MigraDoc.DocumentObjectModel.Tables.VerticalAlignment.Center;

Author:  Thomas Hoevel [ Mon Jun 27, 2011 3:54 pm ]
Post subject:  Re: Table Positioning

Do you really need 5 tables?

A lot can be done with one table and some MergeRight and/or MergeDown. You can set the borders per cell, so it can look like 5 tables while it's actually one.

TextFrames are Shapes and offer various options to position them - and various options to make something wrong ...

Author:  randomBen [ Mon Jun 27, 2011 9:53 pm ]
Post subject:  Re: Table Positioning

I didn't know I could remove borders per cell. How do I do that? Once I can do that then yes, 1 table would work perfectly well.

Also, could you tell me how to doing positioning with text frames? I just want to understand so if I do need it in the future it won't be impossible.

Is there a guide somewhere on what all of the controls are in Migradoc and what the options are and what each one actually controls? I am running VS2010 and the help stuff isn't working at all. I tried to follow the instructions codeplex on how to use the help but there are 0 files under the help folder from what I downloaded and it is very frustrating.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/