This example will arrange rectangles of different sizes(and colors) in a table.

While it's possible to create the same layout we are doing here by positioning each rectangle independently, using a table makes it a lot easier, since the table will control layout of all the objects, allowing you to move, resize or hide the entire table.

We'll start with creating the table, setting it to E\+V\+A\+S\+\_\+\+O\+B\+J\+E\+C\+T\+\_\+\+T\+A\+B\+L\+E\+\_\+\+H\+O\+M\+O\+G\+E\+N\+E\+O\+U\+S\+\_\+\+N\+O\+N\+E to have maximum flexibility and setting its padding to 0\+:  
\begin{DoxyCodeInclude}
   table = \hyperlink{group__Evas__Object__Table_ga599a991a0d7bb22bc9dd7df2d38d4a13}{evas\_object\_table\_add}(d.evas);
   evas\_object\_table\_homogeneous\_set(table, EVAS\_OBJECT\_TABLE\_HOMOGENEOUS\_NONE);
   evas\_object\_table\_padding\_set(table, 0, 0);
   evas\_object\_resize(table, WIDTH, HEIGHT);
   \hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}(table);

\end{DoxyCodeInclude}


We then create each rectangle and add it to the table\+: 
\begin{DoxyCodeInclude}

   rect = \hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}(d.evas);
   \hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}(rect, 255, 0, 0, 255);
   evas\_object\_size\_hint\_min\_set(rect, 100, 50);
   \hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}(rect);
   evas\_object\_table\_pack(table, rect, 1, 1, 2, 1);

   rect = \hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}(d.evas);
   \hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}(rect, 0, 255, 0, 255);
   evas\_object\_size\_hint\_min\_set(rect, 50, 100);
   \hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}(rect);
   evas\_object\_table\_pack(table, rect, 1, 2, 1, 2);

   rect = \hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}(d.evas);
   \hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}(rect, 0, 0, 255, 255);
   evas\_object\_size\_hint\_min\_set(rect, 50, 50);
   \hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}(rect);
   evas\_object\_table\_pack(table, rect, 2, 2, 1, 1);

   rect = \hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}(d.evas);
   \hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}(rect, 255, 255, 0, 255);
   evas\_object\_size\_hint\_min\_set(rect, 50, 50);
   \hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}(rect);
   evas\_object\_table\_pack(table, rect, 2, 3, 1, 1);

\end{DoxyCodeInclude}
 \begin{DoxyNote}{Note}
Each rectangle has a different minimum size based on how many rows and columns it will occupy.
\end{DoxyNote}
The full source for this example follow\+: 
\begin{DoxyCodeInclude}

\textcolor{preprocessor}{#ifdef HAVE\_CONFIG\_H}
\textcolor{preprocessor}{#include "config.h"}
\textcolor{preprocessor}{#endif}

\textcolor{preprocessor}{#include <Ecore.h>}
\textcolor{preprocessor}{#include <\hyperlink{Ecore__Evas_8h}{Ecore\_Evas.h}>}

\textcolor{preprocessor}{#include <stdlib.h>}

\textcolor{preprocessor}{#define WIDTH  100}
\textcolor{preprocessor}{#define HEIGHT 150}

\textcolor{keyword}{struct }test\_data
\{
   Ecore\_Evas  *ee;
   \hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas}        *evas;
   \hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object} *bg;
\};

\textcolor{keyword}{static} \textcolor{keyword}{struct }test\_data d = \{0\};

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
\_on\_destroy(Ecore\_Evas *ee EINA\_UNUSED)
\{
   \hyperlink{group__Ecore__Main__Loop__Group_ga95cf8e97dff0716433c2c5474d606a98}{ecore\_main\_loop\_quit}();
\}

\textcolor{comment}{/* here just to keep our example's window size and background image's}
\textcolor{comment}{ * size in synchrony */}
\textcolor{keyword}{static} \textcolor{keywordtype}{void}
\_canvas\_resize\_cb(Ecore\_Evas *ee)
\{
   \textcolor{keywordtype}{int} w, h;

   \hyperlink{group__Ecore__Evas__Group_ga931aadf4603731e73e8a84e4b14f1493}{ecore\_evas\_geometry\_get}(ee, NULL, NULL, &w, &h);
   evas\_object\_resize(d.bg, w, h);
\}

\textcolor{keywordtype}{int}
main(\textcolor{keywordtype}{void})
\{
   \hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object} *table, *rect;

   \textcolor{keywordflow}{if} (!\hyperlink{group__Ecore__Evas__Group_ga32ddbb6457033ad435a177eb0c4fe235}{ecore\_evas\_init}())
     \textcolor{keywordflow}{return} EXIT\_FAILURE;

   \textcolor{comment}{/* this will give you a window with an Evas canvas under the first}
\textcolor{comment}{    * engine available */}
   d.ee = \hyperlink{group__Ecore__Evas__Group_gac7f2cdbcb79635c34317c1183dd04cb0}{ecore\_evas\_new}(NULL, 0, 0, WIDTH, HEIGHT, NULL);
   \textcolor{keywordflow}{if} (!d.ee)
     \textcolor{keywordflow}{goto} error;

   \hyperlink{group__Ecore__Evas__Group_ga3680b5c89157167318192157a5d24ec4}{ecore\_evas\_callback\_destroy\_set}(d.ee, \_on\_destroy);
   \hyperlink{group__Ecore__Evas__Group_gaac67f679c9027059a34519fbdea360df}{ecore\_evas\_callback\_resize\_set}(d.ee, \_canvas\_resize\_cb);
   \hyperlink{group__Ecore__Evas__Group_ga4953047ff97d4f1b0d75a7d513d4f317}{ecore\_evas\_show}(d.ee);

   \textcolor{comment}{/* the canvas pointer, de facto */}
   d.evas = \hyperlink{group__Ecore__Evas__Group_ga75a7cc694b6069e78df47dab0b0f2d20}{ecore\_evas\_get}(d.ee);

   d.bg = \hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}(d.evas);
   \hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}(d.bg, 255, 255, 255, 255); \textcolor{comment}{/* white bg */}
   evas\_object\_move(d.bg, 0, 0); \textcolor{comment}{/* at canvas' origin */}
   evas\_object\_resize(d.bg, WIDTH, HEIGHT); \textcolor{comment}{/* covers full canvas */}
   \hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}(d.bg);

   table = \hyperlink{group__Evas__Object__Table_ga599a991a0d7bb22bc9dd7df2d38d4a13}{evas\_object\_table\_add}(d.evas);
   evas\_object\_table\_homogeneous\_set(table, EVAS\_OBJECT\_TABLE\_HOMOGENEOUS\_NONE);
   evas\_object\_table\_padding\_set(table, 0, 0);
   evas\_object\_resize(table, WIDTH, HEIGHT);
   \hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}(table);

   rect = \hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}(d.evas);
   \hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}(rect, 255, 0, 0, 255);
   evas\_object\_size\_hint\_min\_set(rect, 100, 50);
   \hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}(rect);
   evas\_object\_table\_pack(table, rect, 1, 1, 2, 1);

   rect = \hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}(d.evas);
   \hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}(rect, 0, 255, 0, 255);
   evas\_object\_size\_hint\_min\_set(rect, 50, 100);
   \hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}(rect);
   evas\_object\_table\_pack(table, rect, 1, 2, 1, 2);

   rect = \hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}(d.evas);
   \hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}(rect, 0, 0, 255, 255);
   evas\_object\_size\_hint\_min\_set(rect, 50, 50);
   \hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}(rect);
   evas\_object\_table\_pack(table, rect, 2, 2, 1, 1);

   rect = \hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}(d.evas);
   \hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}(rect, 255, 255, 0, 255);
   evas\_object\_size\_hint\_min\_set(rect, 50, 50);
   \hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}(rect);
   evas\_object\_table\_pack(table, rect, 2, 3, 1, 1);

   \hyperlink{group__Ecore__Main__Loop__Group_gaf103b9f668bb3e4fed12e52c6180132d}{ecore\_main\_loop\_begin}();

   \hyperlink{group__Ecore__Evas__Group_gad3ec61f2aa03df4d3dbfd0d311e0c8dc}{ecore\_evas\_free}(d.ee);
   \hyperlink{group__Ecore__Evas__Group_gab8fa311077f749190c9b622f672b2214}{ecore\_evas\_shutdown}();
   \textcolor{keywordflow}{return} 0;

error:
   fprintf(stderr, \textcolor{stringliteral}{"you got to have at least one evas engine built and linked"}
                   \textcolor{stringliteral}{" up to ecore-evas for this example to run properly.\(\backslash\)n"});
   \hyperlink{group__Ecore__Evas__Group_gab8fa311077f749190c9b622f672b2214}{ecore\_evas\_shutdown}();
   \textcolor{keywordflow}{return} -1;
\}
\end{DoxyCodeInclude}
 