cattrap-0.6.0.0: Lays out boxes according to the CSS Box Model.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Graphics.Layout.Grid.Table

Description

Datastructures for parsing table styling properties, & for positioning cells into Grid layout regions.

Synopsis

Documentation

type Overflowed = [Int] Source #

Tracks rowspan attributes so later rows can dodge it.

emptyRow :: Overflowed Source #

A row with no cells overflowing into it.

commitRow :: Overflowed -> Overflowed Source #

Decrement all rowspans being overflowed, removing 0'd ones.

allocCol :: Int -> Overflowed -> Int Source #

Find the next column which a previous multi-row cell hasn't called "dibs" on.

insertCell :: Int -> Int -> Int -> Overflowed -> Overflowed Source #

Splice a newly-allocated cell covernig colspan (2nd arg) & rowspan (3rd arg) from "ix" (from 1st arg) into the final arg.

data TableOptions Source #

Parsed CSS properties & HTML attributes for laying out "table" elements. To parse HTML attributes, expects the following useragent stylesheet rules:

rowspan
{ -argo-rowspan: attr(rowspan) }
colspan
{ -argo-colspan: attr(colspan) }

Constructors

TableOptions 

Fields

finalizeGap :: TableOptions -> Font' -> (Length, Length) Source #

Resolve any units in the "border-spacing" property according to the given font. If "border-collapse" is set, removes this spacing.

type UPaddedBox = PaddedBox Unitted Unitted Source #

Shorthand for a padded box without its CSS units resolved, simplifies type signatures.

collapseBorders :: TableOptions -> UPaddedBox -> UPaddedBox Source #

Removes margins & halves borders if "border-collapse" is set, as per the CSS specification. Apply this on the table cells, rows, & columns.

collapseTBorders :: TableOptions -> UPaddedBox -> UPaddedBox Source #

Removes padding & halves borders if "border-collapse" is set, as per the CSS specification. Apply this on the table itself.

half :: Fractional a => (a, b) -> (a, b) Source #

Helper for halving a unit.

finalizeVAlign :: TableOptions -> Alignment Source #

Lower vertical alignment to grid alignment options.

finalizeHAlign :: ParagraphOptions -> Direction -> Alignment Source #

Lower text alignment to grid alignment.