HomeLatest ThreadsGreatest ThreadsForums & GroupsMy SubscriptionsMy Posts
DU Home » Latest Threads » Forums & Groups » Main » Community Help (Forum) » Anyway to simulate a tabl...

Mon Jan 29, 2018, 08:44 PM

Anyway to simulate a table, i.e. to line things up?

Back before June 2017 or whenever the second big hack occurred, there were special HTML tags that allowed one to make tables.

Those special tags have been turned off, apparently permanently
https://www.democraticunderground.com/?com=view_post&forum=1256&pid=13211

So the only way that I can make a table now (i.e. where things are lined up) is by sticking a bunch of back quotes ( ` ) to create spaces (because DU compresses multiple spaces into one space). For example:

----------------------------------------------------------------------------------------------------------------------------
{#} ACTUAL Federal Spending and Deficits - Fiscal Years 2008 - 2017, in $Billions

Fiscal year 2017 ended September 30, 2017. Similarly for all the other fiscal years.

Note: all figures in this section are actual, not budgeted. I only point out that Bush signed the FY 2009 budget.

` ` ` ` ` ` v-last Bush budget was FY 2009 (all figures are actuals, not budgeted)
2008 ` 2009 ` 2010 ` 2011 ` 2012 ` 2013 Fiscal Year
2,983 ` 3,518 ` 3,457 ` 3,603 ` 3,537 ` 3,455 Total Outlays, $Billions
(450) (1,413) (1,294)` (1,300) (1,087)` (680) Surplus (deficit), $Billions
(3.1) ` (9.8) ` (8.7) ` ` (8.5) ` ` (6.8) ` (4.1) Surplus (deficit), % of GDP

2014 ` 2015 ` 2016` 2017 Fiscal Year
3,506` 3,688 ` 3,852 ` 3,981 Total Outlays, $Billions
(485) ` (438) ` (586) ` (666) Surplus (deficit), $Billions
(2.8) `` (2.4) ` (3.2) `` (3.5) Surplus (deficit), % of GDP

----------------------------------------------------------------------------------------------------------------------------

As one can see, it is not pretty, and not all that well lined up, and it takes a long long amount of trial and error to make it line up as well as it is.

And then I don't know how it looks in browsers other than my own -- other browsers / platforms might display a different font and thus it could look way not-lined-up.

A fixed-width font would help a lot (e.g. courier new, where all characters are the same width)...

Anyway, is this the best one can do? Other than, say, building a pretty table in Word or Excel and taking screen snapshots and cropping it and loading it to photobucket or imgur or whatever?

That's a helluva lot of work too for tables that I modify frequently (e.g. the one in my sig line). And people can't "scrape" it for words and numbers of interest since it is an image, not text.

Thanks for any ideas

12 replies, 2425 views

Reply to this thread

Back to top Alert abuse

Always highlight: 10 newest replies | Replies posted after I mark a forum
Replies to this discussion thread

Response to progree (Original post)

Mon Jan 29, 2018, 09:01 PM

1. Try...

Using (ampersand)nbsp;

Note: (ampersand) represents the ampersand character; i.e., &

Here's a bunch to show you it works:

      indented

Reply to this post

Back to top Alert abuse Link here Permalink


Response to TwistOneUp (Reply #1)

Mon Jan 29, 2018, 09:20 PM

4. Thanks - that will look a lot better than those annoying backquotes

though will still require about the same amount of trial and error and who knows how it looks in other browsers -- what looks nicely lined up in mine might be almost unreadable in another fonts.

When I'm piddling in Word in the first draft, I'll probably reduce the (ampersand)nbsp; to character width one and shade it in a medium dark color ...

Reply to this post

Back to top Alert abuse Link here Permalink


Response to progree (Original post)

Mon Jan 29, 2018, 09:04 PM

2. Not since they disabled most of the HTML.

As you stated, the only way to get it to look pretty here now is to use another application and post a picture of the results.

I suggest asking in the ATA forum if they would change the software to accept the [pre] tag. That gets you a monospace font and preserves white space (i.e. doesn't collapse multiple spaces into a single space).

Reply to this post

Back to top Alert abuse Link here Permalink


Response to Make7 (Reply #2)

Mon Jan 29, 2018, 09:13 PM

3. Yup, I remember the [pre] tag with great fondness -- they dropped it years ago when the went

from DU2 to DU3

[pre class="dcplain"]

[/pre]

I've never done the screenshot picture stuff, but it looks like I will be learning real soon.

Reply to this post

Back to top Alert abuse Link here Permalink


Response to progree (Reply #3)

Mon Jan 29, 2018, 09:23 PM

5. You used to be able to do pretty much the same thing with inline style here on DU3.

[div style="font-family:monospace; font-size:1.1em; white-space:pre;"]line 1[br]line 2[br]line 3[br]etc.[/div]

If they add the [pre] tag, there's a good chance we'll also need the [br] tag.

Reply to this post

Back to top Alert abuse Link here Permalink


Response to Make7 (Reply #5)

Mon Jan 29, 2018, 09:39 PM

6. Yup, I used that (or something like that) in the DU3 era until the hack

[div style="font-family:monospace; font-size:1.1em; white-space:pre;"]line 1[br]line 2[br]line 3[br]etc.


Did that leave a blank line between every line?

This is what I used to use -- I had to prepend every line with that huge tag and end each line with the square-bracketed {/div}:

[div style="display:inline; font-size:1.37em; font-family:monospace; white-space:pre;"] v-last Bush budget was FY 2009 (all figures are actuals, not budgeted) {/div}
[div style="display:inline; font-size:1.37em; font-family:monospace; white-space:pre;"] 2008 2009 2010 2011 2012 2013 Fiscal Year{/div}
[div style="display:inline; font-size:1.37em; font-family:monospace; white-space:pre;"] 2,983 3,518 3,457 3,603 3,537 3,454 Total Outlays, $Billions {/div}
[div style="display:inline; font-size:1.37em; font-family:monospace; white-space:pre;"] (450) (1,413) (1,294) (1,300) (1,087) (680) Surplus (deficit), $Billions {/div}
[div style="display:inline; font-size:1.37em; font-family:monospace; white-space:pre;"] (3.1) (9.8) (8.7) (8.5) (6.8) (4.1) Surplus (deficit), % of GDP {/div}

[div style="display:inline; font-size:1.37em; font-family:monospace; white-space:pre;"] 2014 2015 Fiscal Year{/div}
[div style="display:inline; font-size:1.37em; font-family:monospace; white-space:pre;"] 3,504 3,688 Total Outlays, $Billions
[div style="display:inline; font-size:1.37em; font-family:monospace; white-space:pre;"] (483) (439) Surplus (deficit), $Billions {/div}
[div style="display:inline; font-size:1.37em; font-family:monospace; white-space:pre;"] (2.8) (2.5) Surplus (deficit), % of GDP {/div}

When building the table in Word, I just made the huge tag character width one and colored it, so it wasn't so huge and distracting.

Reply to this post

Back to top Alert abuse Link here Permalink


Response to progree (Reply #6)

Thu Feb 1, 2018, 04:27 AM

7. It would double space things if you actually hit enter and started a new line - that's why I used [br] tags.

If you want to go to the effort of trying to do a table looking layout now, I would suggest using all non-breaking spaces to prevent line wrapping.

full width non-breaking space  :   or   or  
half width non-breaking space :   or  

(NOTE: if using non-breaking spaces exclusively, you might need to disable some smileys - I used ( for opening parenthesis below)
_______________________________________


               v-last Bush budget was FY 2009 (all figures are actuals, not budgeted)
 2008     2009     2010     2011     2012     2013     2014     2015     2016     2017   Fiscal Year
2,983    3,518    3,457    3,603    3,537    3,455    3,506    3,688    3,852    3,981   Total Outlays, $Billions
(450)   (1,413)  (1,294)  (1,300)  (1,087)   (680)    (485)     (438)    (586)     (666)   Surplus (deficit), $Billions
(3.1)      (9.8)     (8.7)     (8.5)    (6.8)     (4.1)     (2.8)     (2.4)     (3.2)     (3.5)   Surplus (deficit), % of GDP

_______________________________________

I tried to line that up in NotePad and do a search and replace for all spaces and also the opening parenthesis, but when I copied it here the columns didn't quite align and I had to tweak some lines by deleting or adding spaces and/or half spaces. You can view the HTML source to see how dumb it is - although for something small like this, it isn't overly time consuming. I would probably just do the table in a text editor and take a screen capture and post the picture - using the non-breaking space method probably cuts off the right portion of the data for people browsing with their phones. And who knows if the columns will line up in other desktop browsers/operating systems - I made this post with FireFox58 on Windows7.

God help you if you need to make an edit after posting.

Reply to this post

Back to top Alert abuse Link here Permalink


Response to Make7 (Reply #7)

Thu Feb 1, 2018, 04:29 PM

8. Finally got the image / Imgur thing to work

Thanks much for the tips on the various kinds of spacing, I only knew about the (ampersand)nbsp; one.

The table is lovely!

I finally learned to use Imgur.com and gotten somewhat comfortable with it. But, as Churchill supposedly said (possibly apocryphal, https://winstonchurchill.hillsdale.edu/americans-will-always-right-thing/ )

"Americans can always be trusted to do the right thing, once all other possibilities have been exhausted.


Like Churchill's typical American, I did everything wrong or the most difficult way first.

What seemed to be working is fairly simple now:

- Starting from what is essentially an Ascii text table in Word (but colored and bolded and all that as desired and looking just like I want it to look), and in Courier New 10 font (Courier New is a fixed width font, where every character -- blank, i, w, whatever -- is the same width)

- I used the Windows "Snipping Tool" ( I found it on my Windows Start menu, but if it's not there: Start button -> All Programs (that's near the bottom of the start button menu) -> Accessories -> ... ),

This "Snipping Tool" is a built-in Windows "accessory" with Windows 7.

With the Snipping Tool started, I clicked on the pull-down menu next to New, and, crucially, I selected the "Rectangular Snip" option (it might be that by default) and then just used my mouse (with left button held down) to "draw" a box around my Word table.

When I released the mouse button, the Snipping Tool window appeared with the table in the middle of it. With a hell of a lot of white space around it, but that turned out not to be a problem (all that white space isn't part of the actual "snip" ).

I used Save As (or Control S) and saved it to a file on my computer -- I chose the filename FederalExpensesA.png

Then I went to Imgur.com

I Clicked on the big green New Post button (note that I didn't have to register or log in or any of that)

I Clicked on Browse to browse my file system for where FederalExpensesA.png is and clicked the Open button

and the snip appeared in Imgur with the URL it gave me: https://imgur.com/QMhFGR1

and the actual picture is at xttps://imgur.com/QMhFGR1.png

(but replace the "xttps" with "https" )

and here it is:



=====================================================================================

It's not necessary to save the snip to my computer first, I could have just clicked the Copy icon in the Snipping Tools icon menu bar (or did Control C), and then pasted it with Control V into Imgur where it indicates.

It seems better to have an account at Imgur.com so that I can access all my stuff and edit or delete what I want later, otherwise, after some time period like a couple of hours, I lose the capability for doing that. I guess Imgur eventually deletes orphaned stuff after a period of non-activity.

=====================================================================================

Reply to this post

Back to top Alert abuse Link here Permalink


Response to progree (Reply #8)

Thu Feb 1, 2018, 05:41 PM

10. My table only looks right in FireFox.

Opening it in IE, Vivaldi (Chromium based) or Safari (iPad) the columns are off a little bit - although the spacing is off by the same amount in all three of those. Of course, I might just have something in FireFox set that is making things slightly different (if I zoom in a little - the FireFox spacing matches the others).

Right now, the only way to know things will look as intended here in all browsers is to post an image of the table - it even works for phone browsers because they can just zoom in if needed. Unfortunately, no copying and pasting of any data is possible - although you could put a link to the data (from Dropbox, Google Drive, etc.) if people requested it.

I usually use Lucida Console for a fixed width font because I like the look of a sans-serif font rather than something that looks like an old fashioned typewriter.

To do a chart for a forum, I typically create it in Excel (or similar spreadsheet program) because making changes is so much easier and there are the normal features like summing cells, averaging, inserting charts, importing data, etc. You can just set the fill color for the cells to white to make the cell borders disappear for screen captures.

For an image host, I normally use Imgur because it's quick and easy - I never worried about the possibility of deleted non-viewed images because most of my forum posting is transitory in nature. I don't much care if it gets deleted sometime next year - although I don't recall ever noticing an image that I uploaded to their servers getting deleted (probably because I rarely go back to check).

One more tip - if you want to prevent a web address from becoming a link, picture, or video here, you can insert some useless html tags to prevent the DU software from recognizing it as a URL. For example:

htt[b][/b]ps://imgur.c[b][/b]om/QMhFGR1.p[b][/b]ng

...becomes...

https://imgur.com/QMhFGR1.png

(I tend to put in more empty tags than needed because iOS sometimes tries to make even partial addresses clickable.)

The benefit is that the text URL can be copied and pasted because browsers only care about the content text, not the html tags.

Reply to this post

Back to top Alert abuse Link here Permalink


Response to Make7 (Reply #7)

Thu Feb 1, 2018, 04:50 PM

9. Here's another of my Imgur masterpieces

Job Creation of record of post-WWII Presidents, Average Annual % Increases :

(Sorted from best to worst by average annual percentage increase in jobs. Republicans in red, Democrats in blue.)

Notice that -- with the tiny exception (0.02% difference) of Nixon to Kennedy -- the worst Democrat has a better record than the best Republican. That is, until Obama, who inherited an economy that was losing several hundred thousand jobs a month. And actually, Kennedy did not have a chance to complete his term -- had he done so, and had he had the same job creation numbers in December 1963 through January 1965 as Johnson had (a 3.48%/year annualized rate of increase), he would have easily topped Nixon.

Presidents ranked by Average Annual Percentage Increase In Jobs:

UPDATE image to include Trump

==================================================================
Anyway, I'm working on this for my update of my Economic Statistics "page" at http://www.democraticunderground.com/111622439
where I'm still waiting for some numbers from tomorrow's (Friday's) BLS jobs report.

Here's what it looked like when all the HTML formatting was working
https://web.archive.org/web/20160411173355/http://www.democraticunderground.com/111622439

Reply to this post

Back to top Alert abuse Link here Permalink


Response to progree (Reply #9)

Thu Feb 1, 2018, 06:08 PM

11. That looks great.

If you plan to update a lot of your previous posting that got broken by the disabling of most HTML tags here, you have your work cut out for you. I suppose you could just screen capture the sections from the archive.org captures and insert them as images.

I have so much custom code in my previous posts that is "broken" now that I have never even considered going back to fix any of it. I was kind of disappointed on the "fix" the Admins implemented after the second scripting attack - it seems they used an axe when a scalpel would have been sufficient.

The only post I went back and updated was the Unofficial DU3 Basic HTML Reference Lookup Table in this forum. I waited a long time before changing it because I was hoping they were going to bring back the ability to do custom inline CSS - but it appears that they are not. You can see how it used to look at archive.org. And how it looked when most of the tags stopped working by viewing edit number two here. That was actually a CSS table - so the cells could flexibly resize to fit the person's browser window - lots of code, but most of it just copy and paste.

Reply to this post

Back to top Alert abuse Link here Permalink


Response to Make7 (Reply #11)

Sun Feb 4, 2018, 12:00 AM

12. Thanks much for all the tips in #10 - they were all new to me

If you plan to update a lot of your previous posting that got broken by the disabling of most HTML tags here, you have your work cut out for you.


Fortunately, only those 2 tables I've shown upthread really needed special formatting care.

I was kind of disappointed on the "fix" the Admins implemented after the second scripting attack - it seems they used an axe when a scalpel would have been sufficient.


Yeah, it's hard for me to understand why the ones that have buttons for them -- {b}, {i}, {u}, {link:url|visibleblueunderlined}, and {blockquote} are safe from script attacks, but all the others aren't.

I wish there was a way to have a comment that only I see -- in the old days, anything inside square brackets, including the square brackets, was invisible when posted into DU. I have a ton of stuff with comments in it that I paste into my Economic Statistics page from Word. [Now any such comments are exposed, like this]

The updated version of the Jobs Presidents table in #9 for those curious how Trump did

Presidents ranked by Average Annual Percentage Increase In Jobs:


Of course, Trump is benefiting from the positive momentum that he inherited from Obama, whereas Obama inherited several months of multi-hundred thousand monthly job losses from Bush.

Oh, if someone compares to #9, they will see that the numbers have changed a little bit for Carter and all the presidents thereafter. Every year the Bureau of Labor Statistics revises the damn numbers for several decades. Maybe Obama will eventually edge out Ford in a future revision (when more decimal places are shown, Ford has a slight advantage now).



Reply to this post

Back to top Alert abuse Link here Permalink

Reply to this thread