Hi,
I have a table where I know the column widths but I don’t know the row heights. I output user entered text so each cell can have a different font height. I want the rows to grow as needed. I set a tiny minimum row height, so that the row will grow. If I set a larger minimum height it correctly doesn’t shrink.
The rows grow as expected on the first slide. When I clone the slide, if the minimum row height is under 10, the entire table collapses and all the text is on top of each other.
This only occurs for PPT. PPTX creates an exact clone of the first table.
Thank-you for your time.
Slide slide1 = (Slide) _presentation.Slides[0];
double[] dblCols = { 100, 100, 100 };
//
// not working
//
double[] dblRows = { 9, 9, 9 };
//
// working
//
//double[] dblRows = { 10, 10, 10 };
ITable tbl = slide1.Shapes.AddTable(100, 50, dblCols, dblRows);
foreach (IRow row in tbl.Rows) {
foreach (ICell cell in row) {
cell.TextFrame.Paragraphs[0].Portions[0].PortionFormat.FillFormat.FillType = FillType.Solid;
cell.TextFrame.Paragraphs[0].Portions[0].PortionFormat.FillFormat.SolidFillColor.Color = Color.Black;
cell.BorderTop.FillFormat.FillType = FillType.Solid;
cell.BorderTop.FillFormat.SolidFillColor.Color = Color.Red;
cell.BorderTop.Width = 1;
cell.BorderBottom.FillFormat.FillType = FillType.Solid;
cell.BorderBottom.FillFormat.SolidFillColor.Color = Color.Red;
cell.BorderBottom.Width = 1;
cell.BorderLeft.FillFormat.FillType = FillType.Solid;
cell.BorderLeft.FillFormat.SolidFillColor.Color = Color.Red;
cell.BorderLeft.Width = 1;
cell.BorderRight.FillFormat.FillType = FillType.Solid;
cell.BorderRight.FillFormat.SolidFillColor.Color = Color.Red;
cell.BorderRight.Width = 1;
}
}
tbl[0, 0].TextFrame.Paragraphs[0].Portions[0].Text = “0,0”;
tbl[1, 0].TextFrame.Paragraphs[0].Portions[0].Text = “1,0”;
tbl[2, 0].TextFrame.Paragraphs[0].Portions[0].Text = “2,0”;
tbl[0, 1].TextFrame.Paragraphs[0].Portions[0].Text = “0,1”;
tbl[1, 1].TextFrame.Paragraphs[0].Portions[0].Text = “some really long text to make the cell height increase”;
tbl[2, 1].TextFrame.Paragraphs[0].Portions[0].Text = “2,1”;
tbl[0, 2].TextFrame.Paragraphs[0].Portions[0].Text = “0,2”;
tbl[1, 2].TextFrame.Paragraphs[0].Portions[0].Text = “1,2”;
tbl[2, 2].TextFrame.Paragraphs[0].Portions[0].Text = “2,2”;
Slide slide2 = (Slide) _presentation.Slides.AddClone(slide1);