Text string, width or number of characters

Any ideas how to get a text string to fill a particular width i.e. with a specific character until it reaches the specified width or number of characters?

here’s a function i used for my guestbook.

limitString = function (bString) {
	if (bString.length > 50) {
		bString = bString.slice(0, 50);
		bString += "<font color='#000000'>...more</font>";
		return bString;
	} else {
		return bString;