Say I have the following data:
Raj**SymingtonAvenue$$NiTin**Toronto$$MaHeSH**St Clarens
Avenue$$GErry**Ajax
I want to align these elements in a stright line in a text area like
this:
Raj SymingtonAvenue
NiTin Toronto
MaHeSH St Clarens
GErry Ajax
This I am not able to do. My logic is
--- write the first value, write (40-(# of chars in first value))
spaces, write second value, newline and so on.
But the alignment isnt perfect since (40-(# of chars in first value))
spaces is not a true measure of the length of the first value. Strings with more uppercase letters take more space so the alignment is
coming like:
Raj SymingtonAvenue
NiTin Toronto
MaHeSH St Clarens
GErry Ajax
So how can I get perfect alignment using JavaScript??
Please help
Raj**SymingtonAvenue$$NiTin**Toronto$$MaHeSH**St Clarens
Avenue$$GErry**Ajax
I want to align these elements in a stright line in a text area like
this:
Raj SymingtonAvenue
NiTin Toronto
MaHeSH St Clarens
GErry Ajax
This I am not able to do. My logic is
--- write the first value, write (40-(# of chars in first value))
spaces, write second value, newline and so on.
But the alignment isnt perfect since (40-(# of chars in first value))
spaces is not a true measure of the length of the first value. Strings with more uppercase letters take more space so the alignment is
coming like:
Raj SymingtonAvenue
NiTin Toronto
MaHeSH St Clarens
GErry Ajax
So how can I get perfect alignment using JavaScript??
Please help