# Table to Markdown

## Try it in the Widget Center

Click this [url](https://app.myshell.ai/robot-workshop/widget/1783317709148299264) to try this widget and copy the Pro Config template.

## Usage

This widget is used to convert table file (csv, tsv, excel) to markdown string, which can be directly rendered in the message for better visualization of the data.

**Input Parameters**

<table><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Default</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>document</td><td><code>string</code></td><td>Provide your input csv (.csv).</td><td><a href="https://www.stats.govt.nz/assets/Uploads/Gross-domestic-product/Gross-domestic-product-December-2023-quarter/Download-data/gross-domestic-product-december-2023-quarter-visualisation.csv">default_url</a></td><td>true</td></tr><tr><td>format_from</td><td><code>string</code></td><td>The format of the source table.</td><td>csv</td><td>true</td></tr></tbody></table>

**Output Parameters**

| Name             | Type     | Description                             | File Type |
| ---------------- | -------- | --------------------------------------- | --------- |
| markdown\_string | `string` | The converted result in markdown string |           |

**Output Example**

{% tabs %}
{% tab title="success" %}
{% code fullWidth="false" %}

```json
{
  "markdown_string": "| name   |   age |\n|:-------|------:|\n| Harry  |    18 |\n| Ginny  |    17 |"
}
```

{% endcode %}
{% endtab %}
{% endtabs %}
