Setting table cell heights

Setting table cell heights

Hedge36
Explorer Explorer
230 Views
1 Reply
Message 1 of 2

Setting table cell heights

Hedge36
Explorer
Explorer

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. 

0 Likes
231 Views
1 Reply
Reply (1)
Message 2 of 2

kerry_w_brown
Advisor
Advisor

@Hedge36 

Perhaps you should post your code to give people a better chance of determining your issue.

. . . preferably something compilable.

 

Regards,

 

 

 

 


// Called Kerry or kdub in my other life.

Everything will work just as you expect it to, unless your expectations are incorrect. ~ kdub
Sometimes the question is more important than the answer. ~ kdub

NZST UTC+12 : class keyThumper<T> : Lazy<T>;      another  Swamper
0 Likes