How do I get the heading elements from the TableForm option TableHeadings?

The following,

table =
TableForm[ConstantArray[0, {3, 3}],
TableAlignments -> Right,
TableHeadings -> {None, {"One", "Two", "Three"}}]


I see that its FullForm is

TableForm[
List[
List[HoldForm[\[Placeholder]], HoldForm[\[Placeholder]], HoldForm[\[Placeholder]]],
List[HoldForm[\[Placeholder]], HoldForm[\[Placeholder]], HoldForm[\[Placeholder]]],
List[HoldForm[\[Placeholder]], HoldForm[\[Placeholder]], HoldForm[\[Placeholder]]]],
Rule[TableAlignments, Right],
]
]


and I could parse this to retrieve the value of TableHeadings.

But is there a more canonical approach?

I found that for plots, one can use Options[plot], but I couldn't find a counterpart for tables.

-

Options seems to work just fine:

Options[table, TableHeadings]


(* {TableHeadings -> {None, {"One", "Two", "Three"}}} *)

... slightly generalized:

getopt[obj_, opt_] := opt /. Options[obj, opt]



(* {None, {"One", "Two", "Three"}} *)

-
D'oh! I tried that but my test case was flawed—the options were stripped while copy-pasting a table in TableForm for use in InputForm. Thank you. –  Andrew Cheong Feb 27 '14 at 10:06
Hehe - happy to help :D –  Yves Klett Feb 27 '14 at 10:06
Cases[InputForm[yourTableFormRefHere], HoldPattern[TableHeadings -> a_] :> a, Infinity]


Should do the trick.

-
Works, thanks! I realized though that Options does work and I was simply misusing it. –  Andrew Cheong Feb 27 '14 at 10:06
@acheong87 - lol, I assumed based on the quality of your questions that it didn't, so didn't bother to check. We both get 1 DOH! point... –  ciao Feb 27 '14 at 10:25
IMO, a completely reasonable assumption given the context, haha. –  Andrew Cheong Feb 27 '14 at 10:26