Aligning Columns in a List Box

Question:
I have a List with names and addresses from a database.I want to have the list as shown below.

Mr. Smith          Street 10Mr. Andersson      Street 25
I’ve tried aligning them by adding the appropriate number of spaces to move the street address to column 25 (by subtracting the length of the name from 25), but it always shows up as below:
Mr. Smith         Street 10Mr. Andersson       Stree 25
Why does it do this?

Answer:
In this case, it sounds like you are running into problems because each letter is a different size. The simplest fix is to use Courier New, which is a fixed width font. In this font, each letter is the same width. I’ve run into the same thing and we used the fixed width font approach. An alternative is to use a grid of some sort, which would be a better idea so you don’t have to manually align your data.

Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

The Latest

microsoft careers

Top Careers at Microsoft

Microsoft has gained its position as one of the top companies in the world, and Microsoft careers are flourishing. This multinational company is efficiently developing popular software and computers with other consumer electronics. It is a dream come true for so many people to acquire a high paid, high-prestige job

your company's audio

4 Areas of Your Company Where Your Audio Really Matters

Your company probably relies on audio more than you realize. Whether you’re creating a spoken text message to a colleague or giving a speech, you want your audio to shine. Otherwise, you could cause avoidable friction points and potentially hurt your brand reputation. For example, let’s say you create a

chrome os developer mode

How to Turn on Chrome OS Developer Mode

Google’s Chrome OS is a popular operating system that is widely used on Chromebooks and other devices. While it is designed to be simple and user-friendly, there are times when users may want to access additional features and functionality. One way to do this is by turning on Chrome OS