Solution:
Let the length and the width of the rectangular table be represented as L and W respectively.
Given that the length and the width have a ratio of 8 to 5, this implies that

If the width of the table is 40 in, the length of the table is evaluated as

Hence, the length of the table is 64 in.