In this example we add four labels to a homogeneous table that has a padding of 5px between cells.
The interesting bits from this example are:
- Where we set the table as homogeneous and the padding:
elm_table_padding_set(table, 5, 5);
- Where we add each label to the table:
elm_table_pack(table, label, 0, 0, 1, 1);
elm_table_pack(table, label, 1, 0, 1, 1);
elm_table_pack(table, label, 0, 1, 1, 1);
elm_table_pack(table, label, 1, 1, 1, 1);
Here you can see the full source:
#include <Elementary.h>
EAPI_MAIN int
{
elm_table_padding_set(table, 5, 5);
elm_object_text_set(label, "label 0");
elm_table_pack(table, label, 0, 0, 1, 1);
elm_object_text_set(label, "label 1");
elm_table_pack(table, label, 1, 0, 1, 1);
elm_object_text_set(label, "label 2");
elm_table_pack(table, label, 0, 1, 1, 1);
elm_object_text_set(label, "label 3");
elm_table_pack(table, label, 1, 1, 1, 1);
return 0;
}
Our example will look like this: