A family of Microsoft word processing software products for creating web, email, and print documents.
If you used spaces at the end of the line, then the problem is that, by default, Word doesn't honor an underline under trailing spaces (unless they are nonbreaking). The desktop version of Word has an option (File | Options | Advanced: Layout Options) to "Draw underline on trailing spaces," but you will not have access to this in Word Online.
What you can do instead is set a tab stop where you want the underline to end and underline the tab character.