# code-block-pro/1.28.0/build/shiki/samples/powerquery.sample

Code Block Pro – Beautiful Syntax Highlighting, version 1.28.0. 23 lines.

- Page: https://pluginprobe.com/plugins/code-block-pro/1.28.0/code/build/shiki/samples/powerquery.sample
- Raw: https://pluginprobe.com/plugins/code-block-pro/1.28.0/raw/build/shiki/samples/powerquery.sample
- Modified: 2023-01-28T16:44:20+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/code-block-pro/1.28.0/code/build/shiki/samples/powerquery.sample#L10-L20`.

```
// Transforms a table into markdown syntax
(Table as table) =>
    let
    Source = Table,
    TableValues = Table.AddColumn(
        Source, "Custom", each Text.Combine(Record.FieldValues(_), " | ")
    ),
    HyphenLine = Text.Combine(
      List.Transform(
        Table.ColumnNames(Source), each Text.Repeat("-", Text.Length(_))
      ),
      " | "
    ),
    CombineList = List.Combine(
      {{Text.Combine(Table.ColumnNames(Source), " | ")},
      {HyphenLine}, TableValues[Custom]}
    ),
    TransferToMarkdown = Text.Combine(CombineList, "#(lf)")
  in
    TransferToMarkdown

// From https://github.com/mogulargmbh/powerquerysnippets/blob/main/snippets/Table_ToMarkdown.pq

```
