# 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: 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.atfinity.io/rule-language/operators/string-operators/markdown_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.
