How To: Create a Table

Started by sqlbullet, June 21 2012 10:40:00 AM MDT

Previous topic - Next topic

sqlbullet

Especially for those in posting data to the reloading section, a table is really needed to format data so it can be read.  Most forums don't support this, and we end up with either, a graphic of a table that we can't easily copy, or columns of data that are not properly aligned.

This forum has a table feature.  You can insert a new table by clicking the button in the toolbar above.

This will insert a block of code that looks like this in your topic or reply:

[table]
[tr]
[td][/td]
[/tr]
[/table]


This is somewhat mystical to those unfamiliar with HTML, so I will break it down for you.

[table]

This tag tells the forum where the table starts.  At the end of the table we will place another with a "/" before the word table, to denote the end.

[tr]

This tag tells the forum to start a new row of data in our table.  Again, the end of the row is defined by the same tag, but with a "/" before "tr"

[td]

This is the final tag to understand.  This indicates the start of a cell, or piece of data, in the current row of our table.  Again, the cell ends with the same tag, but with a "/" present.

Putting this all together, here is the code for a four column table with three rows of data, plus a header.

[table]
  [tr]
    [td][b]Row Number   [/b][/td][td][b]Data One   [/b][/td][td][b]Data Two   [/b][/td][td][b]Data Three   [/b][/td]
  [/tr]
  [tr]
    [td]1[/td][td]R1D1[/td][td]R1D2[/td][td]R1D3[/td]
  [/tr]
  [tr]
    [td]2[/td][td]R2D1[/td][td]R2D2[/td][td]R2D3[/td]
  [/tr]
  [tr]
    [td]3[/td][td]R3D1[/td][td]R3D2[/td][td]R3D3[/td]
  [/tr]
[/table]



Row Number   Data One   Data Two   Data Three   
1R1D1R1D2R1D3
2R2D1R2D2R2D3
3R3D1R3D2R3D3

You will notice I used bold tags on the first row, and that I added some spaces around the column titles to help pad the columns a little bit.  Also, be aware that whitespace between tags doesn't matter.  I formatted the example for readability, but when I create tables I keep the rows and data on the same lines.  It looks the same in the output.

It does not appear borders are supported easily at this time.  None the less, this goes a long way toward making posts of tabular data more readable.

Hope this helps!

Turo

Very handy, I shall be using this when I post my next batch of reload data.

Vice

Dude I'm blonde, I was lost when you said click something on the toolbar.

Unless you come over to my house and show me, I'm a lost cause.  But thanks anyway. :D

sqlbullet

Maybe next weekend I can make a movie of the process for you Vice!  Or maybe I can convince the wife we need to make a pilgrimage to Texarkana to visit some friends and we can stop by.

The movie is more likely.

Vice

Hey that just may work. 

Just be sure to go sloow.  But not tooo sllooooww.  :)