#1  
Old 09-24-2018, 08:23 AM
Doctor Jackson's Avatar
Doctor Jackson Doctor Jackson is offline
Guest
 
Join Date: Mar 1999
Location: Jawja
Posts: 9,797
Posting an Excel Table

Is there a way to copy/paste an Excel table, retaining the column spacing, in a post? I tried the BB code tags "code" and "pre", but neither maintained the correct spacing. Thanks in advance, I will likely promptly forget the how to, but at least by creating a thread I can always go back and search!
  #2  
Old 09-24-2018, 12:21 PM
Measure for Measure's Avatar
Measure for Measure Measure for Measure is offline
Charter Member
 
Join Date: Oct 2000
Location: Twitter: @MeasureMeasure
Posts: 13,782
Let's see

copy/paste:
time nuts bolts oranges
1985 1 8 2
1986 8 10 1
1987 8 5 7
1988 10 0 6
1989 4 8 6
1990 9 6 0
1991 2 6 9

Code tags:
Code:
time	nuts	bolts	oranges
1985	1	8	2
1986	8	10	1
1987	8	5	7
1988	10	0	6
1989	4	8	6
1990	9	6	0
1991	2	6	9
When a spreadsheet is copied in, tabs are assumed to separate columns. They appear to be maintained. The problem is that if a large number misaligns the fixed tabs. For example:

Code:
time	nuts	bolts	oranges
1985	1	8	2
1986	8	10	1
1987	8	5	7
1988	545554686	44	6
1989	4	8	6
1990	9	6	0
1991	2	6	9
To address such as situation, paste into a text editor. Then monkey around with fixed spacing. Tack on another tab as appropriate. Paste into box. Preview. Rinse and repeat:
Code:
time	nuts	   bolts	oranges
1985	1	   8		2
1986	8	   10		1
1987	8	   5		7
1988	5454686	   44		6
1989	4	   8		6
1990	9	   6		0
1991	2	   6		9
  #3  
Old 09-24-2018, 02:33 PM
Chronos's Avatar
Chronos Chronos is offline
Charter Member
Moderator
 
Join Date: Jan 2000
Location: The Land of Cleves
Posts: 78,870
Code tags work properly on the desktop theme, but not on the mobile theme. PHP tags work correctly on both, but have odd color-coding that only makes sense for PHP code, and may occasionally have odd side-effects with non-PHP.
  #4  
Old 09-24-2018, 02:49 PM
BigT's Avatar
BigT BigT is offline
Guest
 
Join Date: Aug 2008
Location: "Hicksville", Ark.
Posts: 34,863
I note that I have already fixed that problem in my tweaking addon, and will gladly hand write the entire fix out (along with ones for a couple other things, like spoiler boxes in quotes and the highlighting issue) so that anyone with access to the skin or putting a style tag on the site can fix it.
  #5  
Old 09-24-2018, 06:10 PM
Measure for Measure's Avatar
Measure for Measure Measure for Measure is offline
Charter Member
 
Join Date: Oct 2000
Location: Twitter: @MeasureMeasure
Posts: 13,782
I'll redo my post, substituting php for code tags:

copy/paste:
time nuts bolts oranges
1985 1 8 2
1986 8 10 1
1987 8 5 7
1988 10 0 6
1989 4 8 6
1990 9 6 0
1991 2 6 9

Code tags:
PHP Code:
time    nuts    bolts    oranges
1985    1    8    2
1986    8    10             1
1987    8    5    7
1988    10    0    6
1989    4    8    6
1990    9    6    0
1991    2    6    9 
When a spreadsheet is copied in, tabs are assumed to separate columns. They appear to be maintained. The problem is that if a large number misaligns the fixed tabs. For example:

PHP Code:
time    nuts    bolts    oranges
1985    1    8    2
1986    8    10    1
1987    8    5    7
1988    545554686    44    6
1989    4    8    6
1990    9    6    0
1991    2    6    9 
To address such as situation, paste into a text editor. Then monkey around with fixed spacing. Tack on another tab as appropriate. Paste into box. Preview. Rinse and repeat:
PHP Code:
time    nuts       bolts    oranges
1985    1       8        2
1986    8       10        1
1987    8       5        7
1988    5454686       44        6
1989    4       8        6
1990    9       6        0
1991    2       6        9 
Woops, looks like I need more editing in php:

PHP Code:
time    nuts     bolts    oranges
1985    1          8        2
1986    8         10        1
1987    8          5        7
1988    5454686   44        6
1989    4          8        6
1990    9          6        0
1991    2          6        9 
  #6  
Old 09-25-2018, 07:30 AM
Doctor Jackson's Avatar
Doctor Jackson Doctor Jackson is offline
Guest
 
Join Date: Mar 1999
Location: Jawja
Posts: 9,797
Thanks, all. Looks like, BigT's fix notwithstanding, it's going to always be a pain. I'll try PHP:

PHP Code:
Stays        Drive time    Days    Place
LA        0    5    
        6    1    Phoenix
AZ
        6    1    Las Cruces
NM
        6    1    Lubbock
TX
        6    1    Austin
TX
        6    1    Baton Rouge
LA
        8.5    1    Jacksonville
FL
Jacksonville        0    5    
        7.5    1    Rocky Mount
NC
        9    1    
New YorkNY
NY        0    5    
        6    1    Pittsburgh
PA
        6    1    Indianapolis
IN
        8    1    Eau Claire
WS
        7.5    1    Bismark
ND
        6    1    Billings
MN
        8    1    Spokane
WA
        4    1    Seattle
WA
Seattle        0    5    
        7    1    Medford
, OR
        
6    1    ModestoCA
        6    1    LA
CA
        119.5    38 
Ugh, way too time consuming to tweak the spacing over and over.
  #7  
Old 09-26-2018, 05:31 PM
Measure for Measure's Avatar
Measure for Measure Measure for Measure is offline
Charter Member
 
Join Date: Oct 2000
Location: Twitter: @MeasureMeasure
Posts: 13,782
Quote:
Originally Posted by Doctor Jackson View Post
Ugh, way too time consuming to tweak the spacing over and over.
Ugh is correct. But you get better after a while. I recommend working with a text editor as well the vBulletin window.

Don't have a decent text editor? Get one (MS's Notepad won't display invisible characters). Don't wanna? Then I'd recommend not posting tables; the process is indeed a PIA, though I do it from time to time.
  #8  
Old 10-01-2018, 04:05 AM
Ellis Dee Ellis Dee is offline
Guest
 
Join Date: Jul 2003
Location: New England
Posts: 13,555
In order to avoid the problems the new theme has with code tags, and also the general ugliness of code boxes, I go with courier and hidden dots.

That's my new and improved format, which I'm quite happy with. The previous version left a lot to be desired.

If you want to go with the hidden dots approach, I recommend keeping your lines 60 characters wide or less so phones have a reasonable chance to display them properly in landscape mde.
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 09:05 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc.

Send questions for Cecil Adams to: cecil@straightdope.com

Send comments about this website to: webmaster@straightdope.com

Terms of Use / Privacy Policy

Advertise on the Straight Dope!
(Your direct line to thousands of the smartest, hippest people on the planet, plus a few total dipsticks.)

Copyright 2018 STM Reader, LLC.

 
Copyright © 2017