Difference between revisions of "TableText Command"

From GeoGebra Manual
Jump to: navigation, search
(command syntax: changed [ ] into ( ))
 
(3 intermediate revisions by 2 users not shown)
Line 25: Line 25:
 
:* <code>TableText({1, 2, 3, 4}, {1, 4, 9, 16}, "h")</code> creates a text with two rows and four columns whose elements are left aligned.
 
:* <code>TableText({1, 2, 3, 4}, {1, 4, 9, 16}, "h")</code> creates a text with two rows and four columns whose elements are left aligned.
 
:* <code>TableText({11.2, 123.1, 32423.9, "234.0"}, "vr")</code> creates a text with one column whose elements are right aligned.
 
:* <code>TableText({11.2, 123.1, 32423.9, "234.0"}, "vr")</code> creates a text with one column whose elements are right aligned.
 +
:* <code>TableText({A1:A10, B1:B10, C1:C10}, "vl")</code> creates a text with three columns whose elements (left aligned) are the objects in the given ''Spreadsheet'' cells.
 
:* <code>TableText({{2011.56, 2, 3.7, 4}, {1, 4.2, 9, 16.365}}, "v'''.'''")</code> <br/>creates a text whose elements are aligned on decimal points [[File:TabPtDec.png]]
 
:* <code>TableText({{2011.56, 2, 3.7, 4}, {1, 4.2, 9, 16.365}}, "v'''.'''")</code> <br/>creates a text whose elements are aligned on decimal points [[File:TabPtDec.png]]
 
:* <code>TableText({{2011.56, 2, 3.7, 4}, {1, 4.2, 9, 16.365}}, "v'''%'''")</code> <br/>creates a text whose elements are converted to a percentage, and aligned on decimal points [[File:TableuPourCent.png|200px]] }}
 
:* <code>TableText({{2011.56, 2, 3.7, 4}, {1, 4.2, 9, 16.365}}, "v'''%'''")</code> <br/>creates a text whose elements are converted to a percentage, and aligned on decimal points [[File:TableuPourCent.png|200px]] }}
  
[https://www.geogebra.org/m/Eq5T3vV3 Online examples by Mike]
+
; TableText( &lt;List>, &lt;List>, ..., <Alignment of Text>, <Minimum Cell Width>)
 +
: Creates a text that contains a table of the list objects, with given alignment and cell width (in pixels).
 +
: {{Example|1=<br/>
 +
:* <code>TableText({x², 4}, {x³, 8}, {x⁴, 16}, "c", 50)</code> creates a table with three rows and two columns. All items in the table are centered and the cell width is 50 px.}}
 +
 
  
 +
; TableText( &lt;List>, &lt;List>, ..., <Alignment of Text>, <Minimum Cell Width>, <Minimum Cell Height>)
 +
: Creates a text that contains a table of the list objects, with given alignment, cell width and height (in pixels).
 +
: {{Example|1=<br/>
 +
:*<code>TableText({{"left", "center", "right"}, {"l", "c", "r"}}, "|_lcr", 45, 80)</code> creates a table with two rows and three columns. All items in the table have a different alignment. Each cell of the table is 45 px wide and 80 px high.}}
 +
:{{Note|The ''width'' and the ''height'' of a ''TableText'' depend on the font size setting.}}
  
 
It's also possible to insert:
 
It's also possible to insert:
Line 46: Line 56:
 
:* <code><nowiki>TableText({{1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}}, "|11001 _110001 h")</nowiki></code> creates a table with border and one separation line to the right of the first column and under the first row of contents. The value 1 in the syntax means that there is a separation line between the numbers and the value 0 means that there is no separation line or border.
 
:* <code><nowiki>TableText({{1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}}, "|11001 _110001 h")</nowiki></code> creates a table with border and one separation line to the right of the first column and under the first row of contents. The value 1 in the syntax means that there is a separation line between the numbers and the value 0 means that there is no separation line or border.
 
:*<code><nowiki>TableText({{"\blue{0, 1, 2, 3, 4}", "\red{4, 3, 2, 1, 0}"}}, "v")</nowiki></code> creates a table having the objects in the first row coloured in blue, the ones in the second row coloured in red.}}
 
:*<code><nowiki>TableText({{"\blue{0, 1, 2, 3, 4}", "\red{4, 3, 2, 1, 0}"}}, "v")</nowiki></code> creates a table having the objects in the first row coloured in blue, the ones in the second row coloured in red.}}
 +
 
{{Note|The [[Style Bar]] of a ''TableText'' object allows the user to customize the object's appearance, background and text colour and text style. }}
 
{{Note|The [[Style Bar]] of a ''TableText'' object allows the user to customize the object's appearance, background and text colour and text style. }}
 +
 +
 +
[https://www.geogebra.org/m/Eq5T3vV3 Online examples by Mike]

Latest revision as of 11:55, 14 March 2023


TableText( <List>, <List>, ... )
Creates a text that contains a table of the list objects.
Note: By default, each list is displayed in its own row of the table.
Examples:
  • TableText({x^2, 4}, {x^3, 8}, {x^4, 16}) creates a table as a text object with three rows and two columns. All items of the table are left aligned.
  • TableText(Sequence(i^2, i, 1, 10)) creates a table as a text object with one row. All items of the table are left aligned.


TableText( <List>, <List>, ..., <Alignment of Text> )
Creates a text that contains a table of the list objects. The optional text “Alignment of text” controls the orientation and alignment of the table text, as well as the alignment of the separator in decimal values.
Note: Possible values are "vl", "vc", "vr", "v", "h", "hl", "hc", "hr" and "." or "%" - the default value is "hl".
  • "v" = vertical, i. e. lists are columns
  • "h" = horizontal, i. e. lists are rows
  • "l" = left aligned
  • "r" = right aligned
  • "c" = centered
  • "." = aligned on decimal points
  • "a" = like "." but also displays the padding zeros
  • "%" = converted to a percentage, and aligned on decimal points
  • "p" = like "%" but also displays the padding zeros
Examples:
  • TableText({1, 2, 3, 4}, {1, 4, 9, 16}, "v") creates a text with two columns and four rows whose elements are left aligned.
  • TableText({1, 2, 3, 4}, {1, 4, 9, 16}, "h") creates a text with two rows and four columns whose elements are left aligned.
  • TableText({11.2, 123.1, 32423.9, "234.0"}, "vr") creates a text with one column whose elements are right aligned.
  • TableText({A1:A10, B1:B10, C1:C10}, "vl") creates a text with three columns whose elements (left aligned) are the objects in the given Spreadsheet cells.
  • TableText({{2011.56, 2, 3.7, 4}, {1, 4.2, 9, 16.365}}, "v.")
    creates a text whose elements are aligned on decimal points TabPtDec.png
  • TableText({{2011.56, 2, 3.7, 4}, {1, 4.2, 9, 16.365}}, "v%")
    creates a text whose elements are converted to a percentage, and aligned on decimal points TableuPourCent.png


TableText( <List>, <List>, ..., <Alignment of Text>, <Minimum Cell Width>)
Creates a text that contains a table of the list objects, with given alignment and cell width (in pixels).
Example:
  • TableText({x², 4}, {x³, 8}, {x⁴, 16}, "c", 50) creates a table with three rows and two columns. All items in the table are centered and the cell width is 50 px.


TableText( <List>, <List>, ..., <Alignment of Text>, <Minimum Cell Width>, <Minimum Cell Height>)
Creates a text that contains a table of the list objects, with given alignment, cell width and height (in pixels).
Example:
  • TableText({{"left", "center", "right"}, {"l", "c", "r"}}, "|_lcr", 45, 80) creates a table with two rows and three columns. All items in the table have a different alignment. Each cell of the table is 45 px wide and 80 px high.
Note: The width and the height of a TableText depend on the font size setting.

It's also possible to insert:

  • different types of brackets, using the following symbols ||||, ||, {}, [] or ()
  • line separators, using the symbol _
  • column separators, using the symbol |
  • different colourings
Examples:
  • TableText({1, 2}, {3, 4}, "c()") creates the text \begin{pmatrix}{} 1 & 2 \\ 3 & 4 \\ \end{pmatrix}
  • TableText({1, 2}, {3, 4}, "c|_") creates the text TabellaTesto.png
  • TableText({1, 2}, {3, 4}, "||") creates the text \begin{vmatrix}{} 1 & 2 \\ 3 & 4 \\ \end{vmatrix}
  • TableText({1, 2}, {3, 4}, "||||") creates the text \begin{Vmatrix}{} 1 & 2 \\ 3 & 4 \\ \end{Vmatrix}
  • TableText({{"2x+3y=5","5x+8y=12"}},"{v") creates the text \left\{\begin{matrix} 2x+3y=5\\ 5x+8y=12 \end{matrix}\right.
  • TableText({{1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}}, "-/|_v") creates a table with border and no separation lines.
  • TableText({{1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}}, "|11001 _110001 h") creates a table with border and one separation line to the right of the first column and under the first row of contents. The value 1 in the syntax means that there is a separation line between the numbers and the value 0 means that there is no separation line or border.
  • TableText({{"\blue{0, 1, 2, 3, 4}", "\red{4, 3, 2, 1, 0}"}}, "v") creates a table having the objects in the first row coloured in blue, the ones in the second row coloured in red.


Note: The Style Bar of a TableText object allows the user to customize the object's appearance, background and text colour and text style.


Online examples by Mike

© 2024 International GeoGebra Institute