Html.Table

Html.Table is a Power Query M function that returns a table containing the results of running the specified CSS selectors against the provided HTML.

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365

Syntax

Html.Table(
   html as any,
   columnNameSelectorPairs as list,
   optional options as nullable record,
) as table

Description

Returns a table containing the results of running the specified CSS selectors against the provided html. An optional record parameter, options, may be provided to specify additional properties. The record can contain the following fields:

  • RowSelector

Examples

Returns a table from a sample html text value.

// Output: #table( {"Name", "Title"}, {{"Jo", "Manager"}} )
Html.Table( "
Jo
Manager", {{"Name", ".name"}, {"Title", "span"}}, [RowSelector=".name"] )

Extracts all the hrefs from a sample html text value.

// Output: #table( {"Link"}, {{"/test.html"}} )
Html.Table( "Test", {{"Link", "a", each [Attributes][href]}} )
BI Gorilla Youtube Channel

Last update: November 24, 2023 | Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/html-table
© 2023 BI Gorilla. All rights reserved. Content derived from Microsoft documentation is property of Microsoft Corp.