Jump to content

Adjusting spacing within a field?


Recommended Posts

http://imageshack.us/photo/my-images/811/screenshot20130403at806.png/

 

Working on setting up some business cards. Some of the records have an OfficePhone entry, some have a CellPhone entry, some have both, etc. We made the words "Office" and "Mobile" part of the data (easy fix to make sure they suppressed automatically). The customer wants the plus-signs to line up vertically. is there a way to change the gap between "Office" and "+" without changing the spacing anywhere else? This is how the data reads:

 

OfficePhone CellPhone

"Office +1 513 204 6219" "Mobile +1 513 312 0994"

 

Not sure if it's possible, but you never know.

 

Thank you!

Link to comment
Share on other sites

Sounds like you could use a table to line up everything. I don't know what font and what font size you're using so I didn't mess with the column widths too much but I've commented out beside what you'd need to change to get the table to fit your text. This should get you started:

 

var numbers = [Field("Office"),Field("Mobile")]; // Your field names
numbers = numbers.filter(String);

new FPTable;
var myTable = new FPTable;
myTable.AddColumns(4800, 2000, 14400); // Column 1, 2, & 3 width respectively. 1in = 7200 
myTable.AddRows(numbers.length);

for (var i=0; i<numbers.length; i++){
   myTable.Rows[i].SetContents(numbers[i].split("+")[0], "+", numbers[i].split("+")[1]);
}

return myTable.MakeTags();

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...