kvitable-1.0.2.1: Key/Value Indexed Table container and formatting library
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.KVITable.Render.HTML

Description

This module provides the KVITable render function for rendering the table in a HTML table format. The various HTML table entries have class designators that allow the user to provide CSS to adjust the appearance of the table.

Synopsis

Documentation

render :: Pretty v => RenderConfig -> KVITable v -> Text Source #

Renders the specified table in HTML format, using the specified RenderConfig controls. The output is only the table definition; it is intended to be embedded in a larger HTML document.

data RenderConfig Source #

The RenderConfig specifies the various controls and configurations used when rendering a KVITable in various formats. The RenderConfig is global t oall formats, although some of the fields in the RenderConfig will be ignored as not-applicable by some formats.

Constructors

RenderConfig 

Fields

  • hideBlankRows :: Bool

    True (default) removes rows for which there are no values

  • hideBlankCols :: Bool

    True (default) removes columns for which there are no values

  • equisizedCols :: Bool

    True (default) to maintain a consistent column width, otherwise the columns are shunk to the minimum size needed to display the title and values. Not applicable for some backends (e.g. HTML) where the backend provides table rendering functionality.

  • sortKeyVals :: Bool

    True (default is False) to sort the KeyVal entries when rendering a table.

  • colStackAt :: Maybe Key

    Column key to begin stacking keys in columns and sub-columns rather than creating additional sub-rows.

  • rowRepeat :: Bool

    True (default) if an identical KeyVal is to be repeated in subsequent applicable rows.

  • rowGroup :: [Key]

    List of Key names that should by grouped by inserting horizontal row lines between KeyVals

  • caption :: Maybe Text

    Caption to render for table for backends which support captions; otherwise ignored.

defaultRenderConfig :: RenderConfig Source #

Returns the default rendering configuration, to be used with a format-specific render call.