Similar to the solution I provided in How to draw arrows between parts of an equation to show the Math Distributive Property (Multiplication)?, you can use \tikzmark as defined in Adding a large brace next to a body of text. Each endpoint of the line is identified by \tikzmark, and the \DrawLines macro draws the line between each of the nodes.

You can adjust the shorten <=<size> parameter to start the lines a little later which achieves a nice effect. Here is the result with shorten <=7pt:

Curved lines can also be obtained by specifying in=<angle> and out=<angle> options. For example using \DrawLinesCurved instead of DrawLines you get:

Notes:
- This requires two runs. Once to determine the begin and end point of the lines, and the second to draw them.
- The colors of the 4 lines are passed as parameters to
\DrawLines.
- I used the
-latex arrows here, but if arrows are not desired this option can be removed.
- I used
\raisebox to adjust the position of the text (as requested in the comments).
Code:
\documentclass[12pt]{book}
\usepackage[utf8]{inputenc}
\usepackage[a4paper]{geometry}
\usepackage{graphicx}
\usepackage{array}
\usepackage{tikz}
\usetikzlibrary{calc,shapes}
\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}
\newcommand{\DrawLinesCurved}[4]{%
\begin{tikzpicture}[overlay,remember picture,-latex,shorten >=1pt,shorten <=1pt, thick]
\draw[out=80, in=180, #1] (a.north) to (b.north west);
\draw[out=40, in=180, #2] (a.north) to (c.north west);
\draw[out=320, in=180, #3] (a.north) to (d.north west);
\draw[out=275, in=180, #4] (a.north) to (e.north west);
\end{tikzpicture}
}
\newcommand{\DrawLines}[4]{%
\begin{tikzpicture}[overlay,remember picture,-latex,shorten >=1pt,shorten <=1pt, thick]
\draw[#1] (a.north) to (b.north west);
\draw[#2] (a.north) to (c.north west);
\draw[#3] (a.north) to (d.north west);
\draw[#4] (a.north) to (e.north west);
\end{tikzpicture}
}
\pagestyle{empty}
\begin{document}
\setlength{\extrarowheight}{5pt}
\raisebox{-12pt}{Foo\tikzmark{a}}\hspace*{1.0cm}
\begin{tabular}[c]{ c c c c c c }
& A & B & C & D \ \cline {2-6}
\tikzmark{b}1 & foo A1 & foo B1 & foo C1 & foo D1 \
\tikzmark{c}2 & foo A2 & foo B2 & foo C2 & foo D2 \
\tikzmark{d}3 & foo A3 & foo B3 & foo C3 & foo D3 \
\tikzmark{e}4 & foo A4 & foo B4 & foo C4 & foo D4 \
\end{tabular}
\DrawLines{red}{blue}{green}{orange}
\end{document}
Foois outside of the table. The pacement ofFoohas nothing to do with this solution. You can move it as desired and the arrows will adjust with respect to where it is placed. – Peter Grill Feb 25 '12 at 00:32\DrawLines. I also updated the solution to show how to move the location of the\Footext. – Peter Grill Feb 25 '12 at 01:00-latex. You can just remove that option if you want just a line. – Peter Grill Feb 25 '12 at 01:28\raisebox{-12pt}{Foo\tikzmark{a}}\hspace*{1.0cm}, was it by tries? Or you can determine that? For example: If we multiply that table by 6 times (always a single tabular environment), how do you know where to "locate" the first Foo, then the second one, the third one and so on? – Alenanno Feb 25 '12 at 12:46Foois. I just moved it until it looked liked it was centered as that was not the main thrust of this problem. Since it is unrelated to the drawing of the lines, it seems to me that you should post a separate question with more details on how you want to determine the location. You can reference this question in your new question if it is relevant. – Peter Grill Feb 25 '12 at 17:47