HP Forums
How to create a table - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: Not HP Calculators (/forum-7.html)
+--- Forum: Forum Issues and Administration (/forum-19.html)
+--- Thread: How to create a table (/thread-288.html)



How to create a table - Thomas Klemm - 12-31-2013 07:21 AM

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?


RE: How to create a table - Katie Wasserman - 12-31-2013 05:09 PM

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?


RE: How to create a table - Mark Hardman - 12-31-2013 05:29 PM

(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


RE: How to create a table - Dave Hicks - 01-02-2014 03:18 PM

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.0
10000.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.


RE: How to create a table - Katie Wasserman - 01-02-2014 04:54 PM

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}\)


RE: How to create a table - Thomas Klemm - 01-02-2014 10:45 PM

(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


RE: How to create a table - Dave Hicks - 01-08-2014 05:59 AM

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.


RE: How to create a table - Thomas Klemm - 03-14-2015 08:52 AM

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


RE: How to create a table - matthiaspaul - 03-18-2015 11:29 PM

(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


RE: How to create a table - Katie Wasserman - 03-19-2015 12:30 AM

(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.

Your table would be:

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


RE: How to create a table - Marcus von Cube - 03-19-2015 04:11 PM

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}



RE: How to create a table - Dave Hicks - 03-21-2015 05:27 PM

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.


RE: How to create a table - matthiaspaul - 03-22-2015 11:43 PM

(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


RE: How to create a table - Thomas Klemm - 03-23-2015 08:31 PM

(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