v1

latestOpenAPI 3.0.0Open Government Licence v3.02026-07-23289.7 KB

Parse an html table and generate a json definition

A request to convert an html table (plus supporting data) into the correct RenderRequest format

post/parse/html

Request body

filenamestring required

A unique id for the table

titlestring

The main title of the table

subtitlestring

An additional title or short description of the table

sourcestring

Where the data in the table came from

unitsstring

Name/decription of the units used in the table, if appropriate

keep_headers_togetherboolean

If true, the html output includes a css class designed to prevent content of heading cells being wrapped over 2 lines. Deliberate line breaks will be honoured.

footnotesstring[]

Notes associated with (and potentially referenced from) the table. The order of footnotes is important, e.g. [1] will be converted into a link to the first footnote.

table_htmlstring required

An html snippet containing the <table>...</table> that should be parsed

ignore_first_rowboolean

If true, the first row in the source table is ignored. Can be useful with some js spreadsheet components that insert row and column headers.

ignore_first_columnboolean

If true, the first cell of each row in the source table is ignored. Can be useful with some js spreadsheet components that insert row and column headers.

header_rowsinteger

The number of rows that should be rendered as headings, after ignoring the first row (if applicable).

header_colsinteger

The number of column that should be rendered as headings, after ignoring the first row (if applicable).

cell_size_units'%' | 'em' | 'auto'

The desired unit for cell widths/heights. Pixel widths will be converted to this unit, provided the required information is provided - see current_table_width and single_em_height. The default is 'auto', in which case no table cell widths/heights will be specified.

current_table_widthinteger

The width of the table, used to convert pixel widths to %.

current_table_heightinteger

The height of the table, used to convert pixel heights to %.

single_em_heightnumber

Used to convert height/width from pixels to em. The height of the following: <div style="display: none; font-size: 1em; margin: 0; padding:0; height: auto; line-height: 1; border:0;">m</div>.

column_width_to_ignorestring

If the source html applies a default column width that shouldn't be included in the output, specify it here. e.g. '50px'

Response

A json representation of the table is returned in the body

preview_htmlstring

The html of the table as it would be generated from json