You want to label both the top or bottom row and the left- or
rightmost column, somewhere at the corner of the table where the row
and column meet. A simple way to achieve the result is to construct
the table with an arrangement of rules (and possibly
entries), to look like:
1 2 3 4
However, this doesn't satisfy everyone: many want the labelling in a
single cell at the top left of the table. It sounds a simple enough
requirement, yet it calls for some slightly tricky LaTeX coding.
The diagbox package does this job for you: it defines a
\diagbox whose two arguments provide the texts to be
used; an optional argument may be used for fine tuning of the result.
It draws a picture with the two labels on either side of a slanting
line; the command (and hence the picture) may be placed in the corner
cell, where the labelled row and column meet.