Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Do You Align Columns When Copying Tables to Forum 1

Status
Not open for further replies.

SilentAiche

Technical User
Dec 21, 2004
1,325
US
Hi All:

Is there a way to copy sample tables from Excel, Word, etc. to posts in this forum such that data in the the columns remain properly aligned? I copied some Excel data and the data's PivotTable that turned into what you see below (obviously, the Pivot is much worse):

DATA:

team dep dt amt
angels 1/1/2005 100
reds 1/1/2005 50
cubs 1/2/2005 25
cubs 1/3/2005 75
reds 2/1/2005 15
angels 2/2/2005 10
angels 2/5/2005 95

PIVOT:

Sum of amt team
Years dep dt angels cubs reds Grand Total
2005 Jan 100 100 50 250
Feb 105 15 120
Grand Total 205 100 65 370


Also, if the answer is a
Code:
, is the usage/syntax the same as using [b] etc.?

Any help will be widely appreciated!  
Tim
 
Click on the link "Process TGML" to see the markup codes available. In this case the codes to use are
[ignore][tt] and [/tt][/ignore]
Using those in front and back of your data (after inserting some spaces to make them line up) you can get this:
[tt]
team dep dt amt
angels 1/1/2005 100
reds 1/1/2005 50
cubs 1/2/2005 25
cubs 1/3/2005 75
reds 2/1/2005 15
angels 2/2/2005 10
angels 2/5/2005 95
[/tt]
 
Hey Tim,

When I mentioned in thread68-1003194 about using [ignore][tt][/tt], what I meant was that if you line up the text on your screen before posting, it will look the same after you post. Unfortunately, it isn't as easy as [tt]paste your data from excel[/tt].

Basically the [tt] just sets the spacing up so that every character, whether it's a space or a capital W, is the same width. The box you type new posts into is automatically formatted this way, but the font in the actual post is not - that's why things shift after you press 'submit'. So by using [tt] you can get the data to look good on your screen, press 'preview' or 'submit' and the data will still be spaced the same.

BTW, I'm displaying the [tt] by using [ignore][tt][/tt][/ignore][/ignore]

Does any of that make sense?

[tt]-John[/tt]
________________________
To get the best answers fast, please read faq181-2886
 
Hi,

in a column to the right of your table enter an ARRAY FORMUAL like this, concatenating values for each column in the table and padding with spaces (either after, for text or before for numbers). In my case there's 4 rows
[tt]
=A1&REPT(" ",MAX(LEN($A$1:$A$4))+1-LEN(A1))&REPT(" ",MAX(LEN($B$1:$B$4))+1-LEN(B1))&B1
[/tt]
and the result...
[tt]
Name Amt
Skip 1234
Frank 234567
Grumpie 98876543
[/tt]


Skip,

[glasses] [red]Be advised:[/red] The dyslexic, agnostic, insomniac, lays awake all night wondering...
"Is there really a DOG?" [tongue]
 
Nice, Skip!

BTW, (H), an ARRAY formula is entered by using [ignore][Ctrl]+[Shift]+[Enter][/ignore] instead of just [Enter].

[tt]-John[/tt]
________________________
To get the best answers fast, please read faq181-2886
 

John:

You hit exactly on what I was missing: I thought [tt] did the aligning for you, but it is actually ([switch] not withstanding), still essentially a manual process.

[private note]
Skip,

My last post in the original thread (see John's link) was a classic example of when one should set down the pen/keyboard, and sleep on it, before writing something. The quotation marks just hit me in the wrong way, as though you meant the "solution" was somehow lacking, insufficient, a joke. If it had been, I would not have been surprised -I in no way hold myself out as an expert. They (the quotation marks) implied, at least to my initial reading, that the "solution" was somehow subpar or generally substandard. I guess I was insulted that my first true effort at trying to help a fellow newbie was being so maligned. I misread your intent, and for that I sincerely apologize.

With deepest respect,
Tim
[/public apology]
 


Tim,

You are doing a fine job. Keep up the good work!

Skip,

[glasses] [red]Be advised:[/red] The dyslexic, agnostic, insomniac, lays awake all night wondering...
"Is there really a DOG?" [tongue]
 

Skip,

I gave you a [purple]STAR[/purple] for the simple act of being tremendously civil and generous.

Take care,
Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top