The Money Mustache Community

General Discussion => Forum Information & FAQs => Topic started by: ender on April 20, 2014, 08:56:21 AM

Title: How to - simple step by step guide for posting formatted table
Post by: ender on April 20, 2014, 08:56:21 AM
Quick Reference Links
Get HTML table here (http://www.sensefulsolutions.com/2010/10/format-text-as-table.html)
Get forum table here (http://www.seabreezecomputers.com/html2bbcode/)

-----------

Formatting tables here sucks. Fortunately, there's a good work around. This will be a step by step guide to making your tables look wonderful (and it's easier than fiddling with the forum code!).

Let's say I want to post a table, such as the following:

Quote
Month   Name   Days
1   Jan   31
2   Feb   28
3   Mar   31
4   Apr   30
5   May   31
6   Jun   30
7   Jul   31
8   Aug   31
9   Sep   30
10   Oct   31
11   Nov   30
12   Dec   31

This is copied straight from Excel and, as you can tell, looks... bad.

Getting it into a meaningful format is a two step process. First, go to this website (http://www.sensefulsolutions.com/2010/10/format-text-as-table.html) which lets you convert your Excel table to an html table. Make sure to select Top Row under header style and HTML table under Style. Hitting "Create Table" causes it to look like:

(http://i.imgur.com/fWlY5Lj.png)

Now, this html isn't really helpful either by itself.
Quote
<table><tbody><tr><th>Month</th><th>Name</th><th>Days</th></tr><tr><td>1</td><td>Jan</td><td>31</td></tr><tr><td>2</td><td>Feb</td><td>28</td></tr><tr><td>3</td><td>Mar</td><td>31</td></tr><tr><td>4</td><td>Apr</td><td>30</td></tr><tr><td>5</td><td>May</td><td>31</td></tr><tr><td>6</td><td>Jun</td><td>30</td></tr><tr><td>7</td><td>Jul</td><td>31</td></tr><tr><td>8</td><td>Aug</td><td>31</td></tr><tr><td>9</td><td>Sep</td><td>30</td></tr><tr><td>10</td><td>Oct</td><td>31</td></tr><tr><td>11</td><td>Nov</td><td>30</td></tr><tr><td>12</td><td>Dec</td><td>31</td></tr></tbody></table>

Fortunately... there is a site which converts HTML code into forum code. Go here (http://www.seabreezecomputers.com/html2bbcode/) and copy all that html into the conversion box. Make sure to select SMF Code and thecode/code tag and hit convert.

(http://i.imgur.com/uxL8CsL.png)

Now, copy the ugly looking output into here, and you will see something like:

Code: [Select]
[table][tr][td]Month[/td][td]Name[/td][td]Days[/td][/tr][tr][td]1[/td][td]Jan[/td][td]31[/td][/tr][tr][td]2[/td][td]Feb[/td][td]28[/td][/tr][tr][td]3[/td][td]Mar[/td][td]31[/td][/tr][tr][td]4[/td][td]Apr[/td][td]30[/td][/tr][tr][td]5[/td][td]May[/td][td]31[/td][/tr][tr][td]6[/td][td]Jun[/td][td]30[/td][/tr][tr][td]7[/td][td]Jul[/td][td]31[/td][/tr][tr][td]8[/td][td]Aug[/td][td]31[/td][/tr][tr][td]9[/td][td]Sep[/td][td]30[/td][/tr][tr][td]10[/td][td]Oct[/td][td]31[/td][/tr][tr][td]11[/td][td]Nov[/td][td]30[/td][/tr][tr][td]12[/td][td]Dec[/td][td]31[/td][/tr][/table]

Which, when put into the forum, results in a very nice table where all the columns are aligned and are much easier to read:

MonthNameDays
1Jan31
2Feb28
3Mar31
4Apr30
5May31
6Jun30
7Jul31
8Aug31
9Sep30
10Oct31
11Nov30
12Dec31
Title: Re: How to - simple step by step guide for posting formatted table
Post by: MDM on April 20, 2014, 09:59:30 AM
Nice!

See also http://forum.mrmoneymustache.com/forum-information-faqs/how-to-formatting-a-table (http://forum.mrmoneymustache.com/forum-information-faqs/how-to-formatting-a-table).  Requires going only to one web site but also doing some edits yourself.  Thanks, enderland.

Getting closer - anyone know of a 1-step "convert Excel to SMF table" utility?  And as long as we're dreaming, could the SMF-compatible text be formatted as one line per row, instead of continuous text?
Title: Re: How to - simple step by step guide for posting formatted table
Post by: grantmeaname on April 21, 2014, 04:15:21 PM
February has 29 days some years.