# Table

## ![](/files/4Y6JhGFf19fyFt2BI2H7)Introduction

The Table element can be used to create Rows and Columns to display other elements in a grid-structure with a fixed number of columns and rows that you define.

![insert a column at the indicated location](/files/aI5tf3K65Qn8chBTnGEf)

![insert a row at the indicated location](/files/gNFuNkHtdr73LW8yQkRP)

## Properties

### Table Properties

<table><thead><tr><th width="222">Item</th><th>Description</th></tr></thead><tbody><tr><td><strong>Width</strong></td><td>You can set the width of the table using pixels or percentages or the implicit setting. The default is 100%, which uses all available space of the parent container in which the table is placed. </td></tr><tr><td><strong>Display Mode</strong></td><td>The Table container has 2 main display modes: <em><strong>Default</strong></em> (flat, basic and tight - useful to help position and align other elements) or <em><strong>Bootstrap</strong></em> (advanced, more options to set and usually needs more space).</td></tr><tr><td><em><strong>First column as header</strong></em></td><td>This will show all items in the first column as a header element (usually bold labels, defined by the CSS definition of the chosen Design Template).</td></tr><tr><td><em><strong>First row as header</strong></em></td><td>This will show all items in the first row as a header element (usually bold labels, defined by the CSS definition of the chosen Design Template).</td></tr></tbody></table>

#### Default settings

<table><thead><tr><th width="226">Item</th><th>Description</th></tr></thead><tbody><tr><td><em><strong>Style</strong></em></td><td>you can set the Style to show <em><strong>No border</strong></em> or <em><strong>Table</strong></em>, where it shows borders around the cells (if so supported by the CSS definition in the selected Design Template - that may override this choice and still show no borders).</td></tr><tr><td><em><strong>Cell padding</strong></em></td><td>This adds space between the cell borders and the contents within the cell</td></tr></tbody></table>

#### Bootstrap settings

<table><thead><tr><th width="231">Item</th><th>Description</th></tr></thead><tbody><tr><td><em><strong>Bordered</strong></em> </td><td>If supported by the CSS definition in the Design Template, the table will show borders around the cells.</td></tr><tr><td><em><strong>Condensed</strong></em> </td><td>This will use less whitespace around the table and within the cells, making the element a bit tighter (condensed). By default, a bootstrap-table uses quite some whitespace to nicely place all contents clear and separate.</td></tr><tr><td><em><strong>First column as header</strong></em></td><td>This will show all items in the first column as a header element (usually bold labels, defined by the CSS definition of the chosen Design Template).</td></tr><tr><td><em><strong>First row as header</strong></em></td><td>This will show all items in the first row as a header element (usually bold labels, defined by the CSS definition of the chosen Design Template).</td></tr><tr><td><em><strong>Hoverable rows</strong></em></td><td>This option will support highlighting (changing the background color) when hovering over the row</td></tr><tr><td><em><strong>Striped</strong></em></td><td>This will show all rows with switching background, like a zebra striping (usually clear and light grey background - depending on the chosen Design Template).</td></tr><tr><td><em><strong>Responsiveness</strong></em></td><td><ul><li><em><strong>Stretch -</strong></em> Tries to fill the available space optimally, without showing scrollbars within the table.</li><li><em><strong>Scrollbar -</strong></em> if columns and content need more space than is available, a horizontal scrollbar will be used at the bottom of the table.</li><li><em><strong>Column Break -</strong></em> This option should be used carefully. It tries to break rows and put columns on a next line if space is limited, but this usually yields unexpected and not-so-pretty results.</li></ul></td></tr></tbody></table>

{% hint style="info" %}
A peculiar thing with the Table element is, when you have set  ***Display mode = Bootstrap***, then set the ***First Column as Header*** or ***First Row as Header*** to true, and then change to ***Display mode = Default***, the table will still be showing the first column or row as headers. You just need to know to switch to ***Bootstrap*** to set the options if you want this option for the basic ***Default*** table display.
{% endhint %}

Within the Table, you have Rows and Cells that also each have their own options to play with.

### **Row options:**

<table><thead><tr><th width="232">Item</th><th>Description</th></tr></thead><tbody><tr><td>Height</td><td>You can set a specific height in numeric pixel values</td></tr><tr><td>Visible When</td><td>You can use an expression to decide whether to show or hide the specific row</td></tr></tbody></table>

### &#x20;Cell options:

<table><thead><tr><th width="232">Item</th><th>Description</th></tr></thead><tbody><tr><td><strong>Width</strong></td><td>You can set a specific height in numeric pixel values</td></tr><tr><td><strong>Horizontal align</strong></td><td>choose Left, Center, Justify or Right</td></tr><tr><td><strong>Vertical align</strong></td><td>choose Top, Middle or Bottom to align content in the cell. </td></tr><tr><td><strong>Style context</strong></td><td>If Table is set to Bootstrap, you can set a Style Context on a cell, Allowing you to change to color of a cell</td></tr><tr><td><strong>Enable Tooltip</strong></td><td>allows you to set a tooltip on the whole cell area</td></tr><tr><td><strong>Visible When</strong></td><td>You can use an expression to decide whether to show or hide the specific row</td></tr></tbody></table>

## Illustration

{% hint style="info" %}
This illustration makes use of [Label](/platform/template-editor/layout/label.md). Refer the linked page if you would like to learn more about these widgets.&#x20;
{% endhint %}

Let's continue with the EMS use case from the last topic, Alert, where we had constructed the Employees Overview page. On the page, we had shown the list of employees as cards (using Repeaters) and within a card, we had shown three fields for the employee, one below another, as read-only Form fields. Let's now try to align the three fields vertically within the card.

Note: Although Adaptive Columns would be best suited for this scenario, let's use Table for understanding the element better.   &#x20;

This is what we had from the last topic, Alert.&#x20;

<figure><img src="/files/EneuBLWVyxJnCKlYGBTZ" alt=""><figcaption></figcaption></figure>

Let's remove the three fields from inside the Panel, which we are going to replace with a Table.&#x20;

<figure><img src="/files/oRfr21FHrXj0yxX92Gqr" alt=""><figcaption></figcaption></figure>

1\. Click on the 'Table' icon, drag and drop it on the canvas at the place where you would like to insert it.

<figure><img src="/files/kOLZlkEF8UWSsQJEIpfK" alt=""><figcaption></figcaption></figure>

This inserts a Table that contains one cell, the default Display Mode being Bootstrap. Scroll back up to the Properties Section to learn more about this property.&#x20;

2\. To add a column after a specific column, hover over the top right corner of that column. This will bring up a '+' icon. Click on the icon.&#x20;

<figure><img src="/files/EmlqSY4sHSSBdhzH90eQ" alt=""><figcaption></figcaption></figure>

To add a row before a specific row, hover over the top left corner of that row. This will bring up a '+' icon. Click on the icon.&#x20;

<figure><img src="/files/jVVympD70mbeyuFevFpL" alt=""><figcaption></figcaption></figure>

To add a row after a specific row, hover over the bottom left corner of that row. This will bring up a '+' icon. Click on the icon.  &#x20;

<figure><img src="/files/T5QM3db82g8M51NcBReE" alt=""><figcaption></figcaption></figure>

For our use case, we want a row for the header and a row for the data. We also want 3 columns. So, follow the above steps and add 2 more columns and 1 more row.&#x20;

<figure><img src="/files/LnEE0n9SLj2zN8NQ2EYV" alt=""><figcaption><p>Table with 2 rows and 3 columns</p></figcaption></figure>

3\. Add column headers and add Labels corresponding to the required data fields from the Data Model.&#x20;

<figure><img src="/files/e2UdDycWZQj5hcGZZYNm" alt=""><figcaption></figcaption></figure>

4. Save the Template Editor and Preview.&#x20;

   <figure><img src="/files/maDvzrKtUmJueOIG2UK1" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wem.io/platform/template-editor/layout/table.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
