#13131: Make a top-level table/Table function
----------------------------------+-----------------------------------------
Reporter: kcrisman | Owner: was
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-5.9
Component: user interface | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers: Jason Grout, Karl-Dieter
Crisman
Authors: John Palmieri | Merged in:
Dependencies: | Stopgaps:
----------------------------------+-----------------------------------------
Description changed by jhpalmieri:
Old description:
> As the summary says.
>
> See [https://groups.google.com/forum/?fromgroups#!topic/sage-
> devel/5Ex0erSNyKg this sage-devel thread] for more suggestions, including
> that we should have a `Table` class that `table` calls, which uses
> something like `html.table` in the notebook, but also has a `_latex_`
> method, makes ascii art in the command line, etc.
>
> Just a few examples from the doctests in the patch:
> {{{
> sage: table([['a', 'b', 'c'], [100,2,3], [4,5,60]])
> a b c
> 100 2 3
> 4 5 60
> sage: table([['a', 'b', 'c'], [100,2,3], [4,5,60]], frame=True)
> +-----+---+----+
> | a | b | c |
> +-----+---+----+
> | 100 | 2 | 3 |
> +-----+---+----+
> | 4 | 5 | 60 |
> +-----+---+----+
>
> sage: latex(table([['a', 'b', 'c'], [100,2,3], [4,5,60]],
> frame=True))
> \begin{tabular}{|l|l|l|} \hline
> a & b & c \\ \hline
> $100$ & $2$ & $3$ \\ \hline
> $4$ & $5$ & $60$ \\ \hline
> \end{tabular}
> }}}
> You can also specify alignments of 'left', 'center', or 'right'.
New description:
As the summary says.
See [https://groups.google.com/forum/?fromgroups#!topic/sage-
devel/5Ex0erSNyKg this sage-devel thread] for more suggestions, including
that we should have a `Table` class that `table` calls, which uses
something like `html.table` in the notebook, but also has a `_latex_`
method, makes ascii art in the command line, etc.
Just a few examples from the doctests in the patch:
{{{
sage: table([['a', 'b', 'c'], [100,2,3], [4,5,60]])
a b c
100 2 3
4 5 60
sage: table([['a', 'b', 'c'], [100,2,3], [4,5,60]], frame=True)
+-----+---+----+
| a | b | c |
+-----+---+----+
| 100 | 2 | 3 |
+-----+---+----+
| 4 | 5 | 60 |
+-----+---+----+
sage: latex(table([['a', 'b', 'c'], [100,2,3], [4,5,60]],
frame=True))
\begin{tabular}{|l|l|l|} \hline
a & b & c \\ \hline
$100$ & $2$ & $3$ \\ \hline
$4$ & $5$ & $60$ \\ \hline
\end{tabular}
}}}
You can also specify alignments of 'left', 'center', or 'right'.
Apply [attachment:trac_13131-tables-with-columns.patch].
--
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13131#comment:31>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.