How to create a table
12-31-2013, 07:21 AM
Post: #1
 Thomas Klemm Senior Member Posts: 1,448 Joined: Dec 2013
How to create a table
In a recent thread I tried to create a table:

10: 1.291303564
20: 1.291290482
50: 1.291286729
100: 1.291286183
200: 1.291286042
500: 1.291286006
1000: 1.291285997

For this I used the Unicode character NO-BREAK SPACE U+00A0.
Is there a simpler way to create a table?

Even in a code-block multiple spaces are sometimes ignored:
Code:
      1    10   100  1000
It appears that leading spaces of the first line are ignored. For the following lines at least two spaces are needed. But in a code-block we can't underline. Thus we couldn't use it in this case.

Maybe there's a plug-in for tables?
12-31-2013, 05:09 PM
Post: #2
 Katie Wasserman Super Moderator Posts: 628 Joined: Dec 2013
RE: How to create a table
Quote:Maybe there's a plug-in for tables?

There is! Actually a few of them are described in this this thread.

Dave, what do you think?

-katie

12-31-2013, 05:29 PM
Post: #3
 Mark Hardman Senior Member Posts: 484 Joined: Dec 2013
RE: How to create a table
(12-31-2013 07:21 AM)Thomas Klemm Wrote:  In a recent thread I tried to create a table:

10: 1.291303564
20: 1.291290482
50: 1.291286729
100: 1.291286183
200: 1.291286042
500: 1.291286006
1000: 1.291285997

You could also create the table as a LaTex expression:
$\begin{matrix} 10: & \underline{1.291}303564 \\ 20: & \underline{1.2912}90482 \\ 50: & \underline{1.29128}6729 \\ 100: & \underline{1.29128}6183 \\ 200: & \underline{1.29128}6042 \\ 500: & \underline{1.29128}6006 \\ 1000: & \underline{1.291285997} \end{matrix}$
Mark Hardman

Ceci n'est pas une signature.
01-02-2014, 03:18 PM
Post: #4
 Dave Hicks Super Moderator Posts: 383 Joined: Dec 2013
RE: How to create a table
PHP Code:
Strange    1.0 This is a test    1.0 This is another test   10.0 for($i=0;$i<100; $i++; ) { 100.0$a="hello"; 1000.010000.0 1000.0  100.0

Odd... The PHP blocks get the formatting right, except for the first line, though the PHP syntax coding might bother you. Then again, maybe it won't be that big of a deal for what you are posting.

You might give that a try. I think it will be easy to remove the PHP colors. I'll see if anything can be done to help out the standard code blocks as well. It will be a few days before I can do anything significant. Holiday visits to relatives and ice storms, power outages and staying in homes of strangers has put me well-behind on everything.
01-02-2014, 04:54 PM (This post was last modified: 02-25-2014 01:29 AM by Katie Wasserman.)
Post: #5
 Katie Wasserman Super Moderator Posts: 628 Joined: Dec 2013
RE: How to create a table
You can also use a begin{align} / end{align} block in LaTex when you have an even number of columns. For example:

\begin{align} 1 & 2 & 3 & 4 \\ left & right & left & right \\ 1 & 1 & 3 & 9 \\ 2 & 4 & 4 & 16 \\ not & every & row & has \\ to & use & all & columns \\ 3rd & row \\ & & 4th & row \end{align}

I think this looks better than using a matrix. Here's the original example:

\begin{align} 10: & \underline{1.291}303564 \\ 20: & \underline{1.2912}90482 \\ 50: & \underline{1.29128}6729 \\ 100: & \underline{1.29128}6183 \\ 200: & \underline{1.29128}6042 \\ 500: & \underline{1.29128}6006 \\ 1000: & \underline{1.291285997} \end{align}

-katie

01-02-2014, 10:45 PM
Post: #6
 Thomas Klemm Senior Member Posts: 1,448 Joined: Dec 2013
RE: How to create a table
(01-02-2014 04:54 PM)Katie Wasserman Wrote:  \begin{align} 10: & \underline{1.291}303564 \\ 20: & \underline{1.2912}90482 \\ 50: & \underline{1.29128}6729 \\ 100: & \underline{1.29128}6183 \\ 200: & \underline{1.29128}6042 \\ 500: & \underline{1.29128}6006 \\ 1000: & \underline{1.291285997} \end{align}
That looks great! Thanks for your suggestion. I'll stick to that for the moment. But not all forum members are familiar with $$\LaTeX$$.

Cheers
Thomas
01-08-2014, 05:59 AM (This post was last modified: 01-08-2014 06:02 AM by Dave Hicks.)
Post: #7
 Dave Hicks Super Moderator Posts: 383 Joined: Dec 2013
RE: How to create a table
I've made adjustments to the code block code so these should all line up now:

Code:
    1.0    10.0   100.0  1000.0 10000.0  1000.0

OK - that looks good.
03-14-2015, 08:52 AM
Post: #8
 Thomas Klemm Senior Member Posts: 1,448 Joined: Dec 2013
RE: How to create a table
Displaying a table of information
Quote:This example shows how you can get a table rendered via bbcode using the [table], [tr], [td] and [th] tags.

This doesn't appear to work:
[table]
[tr]
[th]Name[/th]
[th]Age[/th]
[/tr]
[tr]
[td]John[/td]
[td]65[/td]
[/tr]
[tr]
[td]Gitte[/td]
[td]40[/td]
[/tr]
[tr]
[td]Sussie[/td]
[td]19[/td]
[/tr]
[/table]

Cheers
Thomas
03-18-2015, 11:29 PM
Post: #9
 matthiaspaul Senior Member Posts: 385 Joined: Jan 2015
RE: How to create a table
(03-14-2015 08:52 AM)Thomas Klemm Wrote:
Quote:This example shows how you can get a table rendered via bbcode using the [table], [tr], [td] and [th] tags.
This doesn't appear to work:
I don't know about My⁣BB, but in the forum I maintain these BBCodes are not part of the standard repertoire but need to be implemented as Custom BBCodes by the site admin. It's straight forward for IPB. I guess, the MyBB software provides a similar facility.

In my experience, however, only advanced members manage to use them correctly. The outcome might be different in a forum about calculators, though. ;-)

Greetings,

Matthias

--
"Programs are poems for computers."
03-19-2015, 12:30 AM (This post was last modified: 03-19-2015 12:35 AM by Katie Wasserman.)
Post: #10
 Katie Wasserman Super Moderator Posts: 628 Joined: Dec 2013
RE: How to create a table
(03-14-2015 08:52 AM)Thomas Klemm Wrote:  Displaying a table of information
Quote:This example shows how you can get a table rendered via bbcode using the [table], [tr], [td] and [th] tags.

This doesn't appear to work:
......

Take a look at this thread.

\begin{array}{|c|c|}
\hline Name & Age \\\hline
John & 65 \\\hline
Gitte & 40 \\\hline
Sussie & 19 \\\hline
\end{array}

-katie

03-19-2015, 04:11 PM
Post: #11
 Marcus von Cube Senior Member Posts: 754 Joined: Dec 2013
RE: How to create a table
here is Katie's code:

Code:
\begin{array}{|c|c|} \hline Name & Age \\\hline   John & 65 \\\hline   Gitte & 40 \\\hline   Sussie & 19 \\\hline \end{array}

Marcus von Cube
Wehrheim, Germany
http://www.mvcsys.de
http://wp34s.sf.net
http://mvcsys.de/doc/basic-compare.html
03-21-2015, 05:27 PM
Post: #12
 Dave Hicks Super Moderator Posts: 383 Joined: Dec 2013
RE: How to create a table
While I probably could add HTML-like tables like Thomas suggested, I was a little leery of doing this since people seem to mess up with them a lot. I also prefer not to mess with the base code too much since things may have to be reintegrated into future updates. And I thought that people were happy with the latex way of doing it. But if there are problems with the latex solution, I could look into this again.
03-22-2015, 11:43 PM
Post: #13
 matthiaspaul Senior Member Posts: 385 Joined: Jan 2015
RE: How to create a table
(03-21-2015 05:27 PM)Dave Hicks Wrote:  But if there are problems with the latex solution, I could look into this again.
Hm, while I understand that LaTeX is nice to have in a calculator and math related forum, as a maintainer I would be seriously worried about depending on any external resources and using services not hosted locally on the own server - in our forum I maintain a strict anti-cross-site-scripting policy and independance from any client-side scripting for security/privacy reasons. After all, why should a third-party like mathjax.org be able to track visitors of this forum and collect data about them?

Doesn't MyBB provide menus to define Custom BBCodes from the admin console? While this would not be as flexible as what would be possible with PHP, at least in IPB it's powerful enough for tables, and defined this way, they should survive software upgrades as well.

Greetings,

Matthias

--
"Programs are poems for computers."
03-23-2015, 08:31 PM
Post: #14
 Thomas Klemm Senior Member Posts: 1,448 Joined: Dec 2013
RE: How to create a table
(03-19-2015 12:30 AM)Katie Wasserman Wrote:  Your table would be:

Thanks Katie, for your excellent suggestion!

(03-21-2015 05:27 PM)Dave Hicks Wrote:  And I thought that people were happy with the latex way of doing it.

I'm happy with the solution provided by LaTeX. I was just curious whether this example from BBCode works. There's even a disclaimer:

Quote:Doesn't work?
Remember that bbcode tags are implemented to varying degrees and that with many variations. None of this represents strict standards.

Thus I wasn't much surprised.

Cheers
Thomas
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)