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
[tex]\frac{L}{W}=\frac{8}{5}[/tex]If the width of the table is 40 in, the length of the table is evaluated as
[tex]\begin{gathered} \frac{L}{40}=\frac{8}{5} \\ \text{cross multiply} \\ 5\times L=8\times40 \\ \implies5L=320 \\ \text{divide both sides by the coefficient of L, which is 5} \\ \text{thus,} \\ \frac{5L}{5}=\frac{320}{5} \\ \therefore L=64\text{ in.} \end{gathered}[/tex]Hence, the length of the table is 64 in.