Setting table cell heights
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I believe I've read every available thread on this, but it still evades me.
Situation: the specification is that the table's data row height be 0.25. Cells contain text sized at 0.1563. The default cell vertical margin is .06.
When I add a new row to the table (with no content) [table.InsertRows(index, 0.25, 1)], then get properties on any cell in the row, the cell height is 0.3283. That's curious, and I'm wondering if someone can tell me why.
When I add content to that row, I loop through all the cells and explicitly set cell.Borders.Bottom.Margin and cell.Borders.Top.Margin each to:
rowHeight (0.25) - textHeight (0.1563) / 2 (0.04685 margin, top and bottom)
I then loop through all the rows attempting to reinforce the row height:
table.Rows[index].Height = 0.25
This still yields a row where the cell heights are 0.3283. What am I missing?
Curiously, if I set the top and bottom margins to 0, the cell heights are correct at 0.25. What I haven't figured out is how this plays against alignment issues.
Pointers appreciated. I think I've gone so far down this rabbit hole that I might be failing to see the glaringly obvious sun.