Author Topic: How to - simple step by step guide for posting formatted table  (Read 7014 times)

ender

  • Walrus Stache
  • *******
  • Posts: 7402
Quick Reference Links
Get HTML table here
Get forum table here

-----------

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 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:



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 and copy all that html into the conversion box. Make sure to select SMF Code and thecode/code tag and hit convert.



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
« Last Edit: September 12, 2015, 12:42:46 PM by ender »

MDM

  • Senior Mustachian
  • ********
  • Posts: 11493
Re: How to - simple step by step guide for posting formatted table
« Reply #1 on: April 20, 2014, 09:59:30 AM »
Nice!

See also 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?

grantmeaname

  • CM*MW 2023 Attendees
  • Walrus Stache
  • *
  • Posts: 5987
  • Age: 31
  • Location: Middle West
  • Cast me away from yesterday's things
Re: How to - simple step by step guide for posting formatted table
« Reply #2 on: April 21, 2014, 04:15:21 PM »
February has 29 days some years.