> For the complete documentation index, see [llms.txt](https://docs.atfinity.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.atfinity.io/rule-language/operators/string-operators/markdown_table.md).

# markdown\_table

### Description

`markdown_table` turns a list of data points into a table in the markdown format, that can be rendered on documents or in the case.

`markdown_table` takes either

1. a list of dictionaries, where the keys of the first dictionary represent the columns and the values of each dictionary are the rows of the table or
2. a list of lists where the values in each list are the rows and a second argument of a list of keys to use as columns of the table

### Example with list and header

```
header := ['Last Name', 'First Name']
data := [['Croisé', 'Thorben'], ['Zivic', 'Tijana'], ['Balzer', 'Alexander']]
markdown_table(data, header)
```

This outputs a markdown table with the columns `Last Name` and `First Name` and the rows of the names of the Thorben, Tijana and Alexander:

```
| Last Name | First Name |
| --------- | ---------- |
| Croisé    | Thorben    |
| Zivic     | Tijana     |
| Balzer    | Alexander  |
```

### Example with dictionaries

```
data := [
    {'Last Name': 'Croisé', 'First Name': 'Thorben'},
    {'Last Name': 'Zivic', 'First Name': 'Tijana'},
    {'Last Name': 'Balzer', 'First Name': 'Alexander'},
]
markdown_table(data)
```

Will output the same table as the first example.

### Example with alignment options

```
header := ['Animal Color', 'Animal']
data := [['Red', 'Bird'], ['Blue', 'Whale']]
markdown_table(data, header, options: {
    styles: {0: {'align': 'center'}, 'Animal': {'align': 'right'}}
})
```

Outputs a list where the first column is left aligned and the column with the key `Animal` is right aligned:

```
| Animal Color | Animal |
| :----------: | -----: |
|     Red      |   Bird |
|     Blue     |  Whale |
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.atfinity.io/rule-language/operators/string-operators/markdown_table.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
