Difference between revisions of "Textutils.pagedTabulate"

From ComputerCraft Wiki
Jump to: navigation, search
(Created page with "{{lowercase}} {{Function |name=textutils.pagedTabulate |args= table table1, table table2, ... |returns=Nothing. |api=textutils |addon=Compute...")
 
(Updated/Improved)
 
(One intermediate revision by one other user not shown)
Line 2: Line 2:
 
{{Function
 
{{Function
 
|name=textutils.pagedTabulate
 
|name=textutils.pagedTabulate
|args= [[table (type)|table]] table1, [[table (type)|table]] table2, ...
+
|args={{type|table}} table/{{type|number}} color, {{type|table}} table2/{{type|number}} color2, ...
|returns=Nothing.
+
 
|api=textutils
 
|api=textutils
 
|addon=ComputerCraft
 
|addon=ComputerCraft
|desc=Prints tables in an ordered form. Each table is a row, each column's width is auto-adjusted for consistency between rows. Unlike [[Textutils.tabulate|textutils.tabulate()]], if scrolling is required in order to fit the whole of the output onto the display this function will throw up a "Press any key to continue" prompt at the bottom - each press will cause it to scroll down and write a single line more (before prompting again, if need be).
+
|desc=Prints tables in an ordered form. Each table is a row, each column's width is auto-adjusted for consistency between rows. If it encounters a number instead of a table then sets the text color to it. Unlike [[textutils.tabulate]](), if scrolling is required in order to fit the whole of the output onto the display this function will throw up a "Press any key to continue" prompt at the bottom - each press will cause it to scroll down and write a single line more (before prompting again, if need be).
 
|examples=
 
|examples=
 
{{Example
 
{{Example
|desc=Prints a lengthy table.
+
|desc=Prints two tables in an ordered form.
|code=local myTable = {}
+
|code='''textutils.tabulate( [[colors_(API)|colors]].orange, {1,2,3}, [[colors_(API)|colors]].lightBlue, {"A","B","C"} )'''
for i=1,600 do myTable[i] = i end
+
|output=Prints:
textutils.pagedTabulate(myTable)
+
<span style="color:#F2B233">1.0  2.0  3.0</span>
|output=Prints a lengthy list of numerals, but prompts the user to "Press any key to continue" before scrolling the top of the list outside of the display.
+
<span style="color:#99B2F2">A    B    C</span>
 +
&nbsp;
 
}}
 
}}
 
}}
 
}}
  
 
[[Category:API_Functions]]
 
[[Category:API_Functions]]

Latest revision as of 21:00, 16 February 2015


Grid Redstone.png  Function textutils.pagedTabulate
Prints tables in an ordered form. Each table is a row, each column's width is auto-adjusted for consistency between rows. If it encounters a number instead of a table then sets the text color to it. Unlike textutils.tabulate(), if scrolling is required in order to fit the whole of the output onto the display this function will throw up a "Press any key to continue" prompt at the bottom - each press will cause it to scroll down and write a single line more (before prompting again, if need be).
Syntax textutils.pagedTabulate(table table/number color, table table2/number color2, ...)
Returns nil
Part of ComputerCraft
API textutils

Examples

Grid paper.png  Example
Prints two tables in an ordered form.
Code
textutils.tabulate( colors.orange, {1,2,3}, colors.lightBlue, {"A","B","C"} )
Output Prints:
1.0   2.0   3.0
A     B     C