TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How would you draw a table, i.e. the piece of furniture on which one eats, like the following in Tikz? As always, I am very grateful for your clever tikz constructions! table attacked by arrows

share|improve this question
There is a website texample.net which lists a lot of TikZ examples. Have a look if you find what you are looking for there. If not it would be a good idea to upload the solution to your drawing request there, so other people find them more easily. – Martin Scharrer Apr 4 '11 at 7:49
Thanks, Martin, I plan on doing just that at the end of the project on which Im currently working! From what I understand, the license under which answers appear here allows this kind of cross-posting as long as I link back to the original answer. – Thanos D. Papaïoannou Apr 4 '11 at 22:47
up vote 21 down vote accepted

Here is a crude solution. With time and refactoring, an elegant solution may be written up.

The key part is to use the 3-dimensional coordinate system.

I only drew the table.


\foreach \leg in {(0.3,0,0),(4.9,0,0),(4.9,0,-2.7),(0.3,0,-2.7)}{
\draw[fill] (0,0,0) -- (0,0,-0.2) -- (0,2,-0.2) -- (0,2,0);
\draw[fill] (0,0,0) rectangle (-0.2,2,0);

\draw[fill] (0,0,0) -- (5,0,0) -- (5,0,-3) -- (0,0,-3) -- cycle;
\draw[fill] (0,0,0) -- (5,0,0) -- (5,-0.1,0)-- (0,-0.1,0) -- cycle;
\draw[fill] (5,0,0) -- (5,0,-3) -- (5,-0.1,-3)-- (5,-0.1,0) -- cycle;


The result is

enter image description here

Hera is another version of the code. It is longer, but it uses macros defined at the beginning, to make it easier to modify the table.


%table dimensions

%leg dimensions


\foreach \leg in {(0+\shift,0,0),(\tablelength-\shift,0,-\shift),
        (\halflegwidth,0,\halflegwidth) -- (\halflegwidth,0,-\halflegwidth) -- 
        (\halflegwidth,\leglength,-\halflegwidth) --    

        (\halflegwidth,0,\halflegwidth) rectangle 

    (0,0,0) -- (\tablelength,0,0) -- (\tablelength,0,-\tablewidth) -- 
     (0,0,-\tablewidth) -- cycle

    (0,0,0) -- (\tablelength,0,0) -- (\tablelength,-\tablethickness,0)--
     (0,-\tablethickness,0) -- cycle

    (\tablelength,0,0) -- (\tablelength,0,-\tablewidth) -- 
    (\tablelength,-\tablethickness,0) -- cycle;

share|improve this answer
Merci, Frédéric! – Thanos D. Papaïoannou Apr 4 '11 at 14:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.