# No dividing lines for headers in TableForm

I seem to get this a lot, but I still can't find a systematic answer... The latest table I'm having trouble with is

table1 = Table[{x, "\[Rule]", x/2,
"\[Rule]", (2*(x/2))/(1 + (x/2)^2),
"\[Rule]", ((2*(x/2))/(1 + (x/2)^2))^k, "\[Rule]",
((2*(x/2))/(1 + (x/2)^2))^k /. e -> 0 /.
k -> Infinity}, {x, {{1 + e}, {2 + e}, {3 + e}}}];
Labeled[TableForm[table1,
TableHeadings -> {{"x < 2", "x = 2", "x > 2"},
Style["\nWHY NO DIVIDING LINES?\n", Bold], {Top}]


Why can't I get the thing to produce dividers between the TableHeadings and the body of the table?

It's because table1 isn't an array:

ArrayQ[table1]
(*False*)


You have a couple of options. If you change your definition to make your input an array, for example by removing an extra level of lists from your definition of x:

table2=Table[
{x,"->",x/2,"->",(2*(x/2))/(1+(x/2)^2),"->",((2*(x/2))/(1+(x/2)^2))^k,"->",((2*(x/2))/(1+(x/2)^2))^k/.e->0/.k->Infinity},
{x,{1+e,2+e,3+e}}
]

Alternatively add an explict TableDepth to force the input to be interpreted as a matrix. This will show the nested lists that prevent the input from being an array:
TableForm[table1, TableHeadings -> {{"x < 2", "x = 2", "x > 2"}, {"heading 1", "",

If the input isn't an array of sufficient depth, TableForm falls back to legacy code that doesn't support dividers. That may be overly strict, but it's how the code currently works.