# How can I write tables on Socratic?

Ideas on matrix, spacing, and fractional ways to make a table

#### Explanation:

Let's say I have some points I want to graph and I want to present them in a table format. I'll have a column for $x$ values and another for $y$ values.

There are a couple of ways to do it:

• use matrix formatting

This is the method I prefer to use. Here I use the format:

hashtag ( ( x, y), (1, 5), (2, 4) ) hashtag

This will return

$\left(\begin{matrix}x & y \\ 1 & 5 \\ 2 & 4\end{matrix}\right)$

With this I can now also use things like vertical dots (vdots), diagonal dots (ddots), white space to hold open a particular cell, etc.

A sample of what I've used it for is a table showing the list of possible die rolls using 2 standard dice:

$\left(\begin{matrix}\textcolor{w h i t e}{0} & \underline{1} & \underline{2} & \underline{3} & \underline{4} & \underline{5} & \underline{6} \\ 1 | & 2 & 3 & 4 & 5 & 6 & 7 \\ 2 | & 3 & 4 & 5 & 6 & 7 & 8 \\ 3 | & 4 & 5 & 6 & 7 & 8 & 9 \\ 4 | & 5 & 6 & 7 & 8 & 9 & 10 \\ 5 | & 6 & 7 & 8 & 9 & 10 & 11 \\ 6 | & 7 & 8 & 9 & 10 & 11 & 12\end{matrix}\right)$

• use spacing and white space

Alignment of cells is, in my opinion, harder with this method, but it can be done.

I can do something like this:

hashtag color(white)(00000) x color(white)(00000) y hashtag
hashtag color(white)(00000) 1 color(white)(00000) 5 hashtag
hashtag color(white)(00000) 2 color(white)(00000) 4 hashtag

and it will return:

$\textcolor{w h i t e}{00000} x \textcolor{w h i t e}{00000} y$
$\textcolor{w h i t e}{00000} 1 \textcolor{w h i t e}{00000} 5$
$\textcolor{w h i t e}{00000} 2 \textcolor{w h i t e}{00000} 4$

• use fractional formatting

I'm not sure of the usefulness in making a larger table, but for something small it could work.

I can write something like:

hashtag color(white)00000color(black) x/color(black)1 00000 color(black) y/color(black)5 hashtag
hashtag color(white)00000color(black) 2/1 00000 color(black) 4/5 hashtag

which will return:

$\textcolor{w h i t e}{00000 \frac{\textcolor{b l a c k}{x}}{\textcolor{b l a c k}{1}} 00000 \frac{\textcolor{b l a c k}{y}}{\textcolor{b l a c k}{5}}}$
$\textcolor{w h i t e}{00000 \frac{\textcolor{b l a c k}{2}}{2} 00000 \frac{\textcolor{b l a c k}{4}}{5}}$

May 11, 2017

Other examples include...

#### Explanation:

You can play around a bit with the matrix design to get really cool tables.

For example, using the matrix Parzival used in his answer

• without hashtags

( (color(white)(0),ul1,ul2,ul3,ul4,ul5,ul6),(1|,2,3,4,5,6,7),(2|,3,4,5,6,7,8),(3|,4,5,6,7,8,9),(4|,5,6,7,8,9,10),(5|,6,7,8,9,10,11),(6|,7,8,9,10,11,12) )

• with hashtags

$\left(\begin{matrix}\textcolor{w h i t e}{0} & \underline{1} & \underline{2} & \underline{3} & \underline{4} & \underline{5} & \underline{6} \\ 1 | & 2 & 3 & 4 & 5 & 6 & 7 \\ 2 | & 3 & 4 & 5 & 6 & 7 & 8 \\ 3 | & 4 & 5 & 6 & 7 & 8 & 9 \\ 4 | & 5 & 6 & 7 & 8 & 9 & 10 \\ 5 | & 6 & 7 & 8 & 9 & 10 & 11 \\ 6 | & 7 & 8 & 9 & 10 & 11 & 12\end{matrix}\right)$

you can have something like this

• without hashtags

{: (color(white)(0),ul1,ul2,ul3,ul4,ul5,ul6),(1|,2,3,4,5,6,7),(2|,3,4,5,6,7,8),(3|,4,5,6,7,8,9),(4|,5,6,7,8,9,10),(5|,6,7,8,9,10,11),(6|,7,8,9,10,11,12) :}

• with hashtags

$\left.\begin{matrix}\textcolor{w h i t e}{0} & \underline{1} & \underline{2} & \underline{3} & \underline{4} & \underline{5} & \underline{6} \\ 1 | & 2 & 3 & 4 & 5 & 6 & 7 \\ 2 | & 3 & 4 & 5 & 6 & 7 & 8 \\ 3 | & 4 & 5 & 6 & 7 & 8 & 9 \\ 4 | & 5 & 6 & 7 & 8 & 9 & 10 \\ 5 | & 6 & 7 & 8 & 9 & 10 & 11 \\ 6 | & 7 & 8 & 9 & 10 & 11 & 12\end{matrix}\right.$

Notice that if you replace the first parenthesis with $\text{{:}$ and the last parenthesis with $\text{:}}$, you can make the borders of the matrix invisible.

You can also add a bit of spacing and some color to get something like this

• without hashtags

{: (color(white)(0)," "ul1" "," "ul2" "," "ul3" "," "ul4" "," "ul5" "," "ul6" "),(1|," "2" "," "3" "," "4" "," "5" "," "6" "," "color(red)(7)" "),(2|," "3" "," "4" "," "5" "," "6" "," "color(red)(7)" "," "8" "),(3|," "4" "," "5" "," "6" "," "color(red)(7)" "," "8" "," "9" "),(4|," "5" "," "6" "," "color(red)(7)" "," "8" "," "9" "," "10" "),(5|," "6" "," "color(red)(7)" "," "8" "," "9" "," "10" "," "11" "),(6|," "color(red)(7)" "," "8" "," "9" "," "10" "," "11" "," "12" ") :}

• with hashtags*

$\left.\begin{matrix}\textcolor{w h i t e}{0} & \text{ "ul1" " & " "ul2" " & " "ul3" " & " "ul4" " & " "ul5" " & " "ul6" " \\ 1| & " "2" " & " "3" " & " "4" " & " "5" " & " "6" " & " "color(red)(7)" " \\ 2| & " "3" " & " "4" " & " "5" " & " "6" " & " "color(red)(7)" " & " "8" " \\ 3| & " "4" " & " "5" " & " "6" " & " "color(red)(7)" " & " "8" " & " "9" " \\ 4| & " "5" " & " "6" " & " "color(red)(7)" " & " "8" " & " "9" " & " "10" " \\ 5| & " "6" " & " "color(red)(7)" " & " "8" " & " "9" " & " "10" " & " "11" " \\ 6| & " "color(red)(7)" " & " "8" " & " "9" " & " "10" " & " "11" " & " "12" }\end{matrix}\right.$

Pretty cool, right? :D

Like Parzival showed in his answer, you can create spacing by using white characters. The following is taken from this answer.

Alternatively, you can ditch the matrix syntax altogether and simply use color(white)() to create the spacing you need.

• without hashtags

color(white)(aaaaa color(black)("something")aaaaaaacolor(black)("something else")aaaa)

color(white)(aaaaaaaacolor(black)("yes")aaaaaaaaaaaaaaacolor(black)("no")aaaa)

color(white)(aaaaaaaacolor(black)("yes")aaaaaaaaaaaaaaacolor(black)("yes")aaaa)

color(white)(aaaaaaaacolor(black)("no")aaaaaaaaaaaaaaaacolor(black)("no")aaaa)

• with hashtags

$\textcolor{w h i t e}{a a a a a \textcolor{b l a c k}{\text{something")aaaaaaacolor(black)("something else}} a a a a}$

$\textcolor{w h i t e}{a a a a a a a a \textcolor{b l a c k}{\text{yes")aaaaaaaaaaaaaaacolor(black)("no}} a a a a}$

$\textcolor{w h i t e}{a a a a a a a a \textcolor{b l a c k}{\text{yes")aaaaaaaaaaaaaaacolor(black)("yes}} a a a a}$

$\textcolor{w h i t e}{a a a a a a a a \textcolor{b l a c k}{\text{no")aaaaaaaaaaaaaaaacolor(black)("no}} a a a a}$

You can add a bit of flavor by using other colors.

• without hashtags

color(white)(aaaaa color(blue)(ul("something"))aaaaaaacolor(purple)(ul("something else"))aaaa)

color(white)(aaaaaaaacolor(green)("yes")aaaaaaaaaaaaaaacolor(red)("no")aaaa)

color(white)(aaaaaaaacolor(green)("yes")aaaaaaaaaaaaaaacolor(green)("yes")aaaa)

color(white)(aaaaaaaacolor(red)("no")aaaaaaaaaaaaaaaacolor(red)("no")aaaa)

• with hashtags

$\textcolor{w h i t e}{a a a a a \textcolor{b l u e}{\text{something")aaaaaaacolor(purple)("something else}} a a a a}$

$\textcolor{w h i t e}{a a a a a a a a \textcolor{g r e e n}{\text{yes")aaaaaaaaaaaaaaacolor(red)("no}} a a a a}$

$\textcolor{w h i t e}{a a a a a a a a \textcolor{g r e e n}{\text{yes")aaaaaaaaaaaaaaacolor(green)("yes}} a a a a}$

$\textcolor{w h i t e}{a a a a a a a a \textcolor{red}{\text{no")aaaaaaaaaaaaaaaacolor(red)("no}} a a a a}$

You can even add a horizontal line if you want

• without hashtags

color(black)(ul(color(white)(aaaaa color(blue)("something")aaaaaaacolor(purple)("something else")aaaa))

color(white)(aaaaaaaacolor(green)("yes")aaaaaaaaaaaaaaacolor(red)("no")aaaa)

color(white)(aaaaaaaacolor(green)("yes")aaaaaaaaaaaaaaacolor(green)("yes")aaaa)

color(white)(aaaaaaaacolor(red)("no")aaaaaaaaaaaaaaaacolor(red)("no")aaaa)

• with hashtags

color(black)(ul(color(white)(aaaaa color(blue)("something")aaaaaaacolor(purple)("something else")aaaa))

$\textcolor{w h i t e}{a a a a a a a a \textcolor{g r e e n}{\text{yes")aaaaaaaaaaaaaaacolor(red)("no}} a a a a}$

$\textcolor{w h i t e}{a a a a a a a a \textcolor{g r e e n}{\text{yes")aaaaaaaaaaaaaaacolor(green)("yes}} a a a a}$

$\textcolor{w h i t e}{a a a a a a a a \textcolor{red}{\text{no")aaaaaaaaaaaaaaaacolor(red)("no}} a a a a}$

This might look a bit intimidating at first, but you'll get the hang of it in no time if you practice.

Enjoy! :D

Jul 20, 2017

There's somewhat of a workaround. A table can be formatted with some careful spacing, and an underline command can be used to mark the header.

$\underline{\text{Trial"" ""Item 1 (unit)"" ""Item 2 (unit)"" ""Item 3 (unit)}}$
$1 \text{ "" "" "0.05" "" "" "" "0.07" "" "" "" "" } 0.08$

$2 \text{ "" "" "0.07" "" "" "" "0.04" "" "" "" "" } 0.12$

$3 \text{ "" "" "0.02" "" "" "" "0.06" "" "" "" "" } 0.09$

The MathJax looks like:

$\text{>}$hashtagul("Trial"" ""Item 1 (unit)"" ""Item 2 (unit)"" ""Item 3 (unit)")hashtag
$\text{>}$hashtag1" "" "" "0.05" "" "" "" "0.07" "" "" "" "" "0.08hashtag

$\text{>}$hashtag2" "" "" "0.07" "" "" "" "0.04" "" "" "" "" "0.12hashtag

$\text{>}$hashtag3" "" "" "0.02" "" "" "" "0.06" "" "" "" "" "0.09hashtag