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

  • 2
    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. Apr 4, 2011 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. Apr 4, 2011 at 22:47

1 Answer 1


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;


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .