%-----------------------------------------------------------------------------% % html.td.m % Ralph Becket % Tue Oct 15 15:14:32 EST 2002 % vim: ft=mercury ff=unix ts=4 sw=4 et wm=0 tw=0 % %-----------------------------------------------------------------------------% :- module html__td. :- interface. :- type table_cells. % Type of table cells. :- instance html(table_cells). % Attributes: % - align - horizontal alignment of cell % - valign - vertical alignment of cell % - width - width of cell contents % - border - width of cell contents % - cellspacing - padding around each cell % - callpadding - padding inside each cell % - rowspan - cell spans multiple rows % - colspan - cell spans multiple columns % - nowrap - disable word wrapping within cell % :- func th(M) = table_cells <= html(M). :- func td(M) = table_cells <= html(M). :- func attr >> table_cells = table_cells. :- func table_cells ++ table_cells = table_cells. :- func nil = table_cells. %-----------------------------------------------------------------------------% %-----------------------------------------------------------------------------% :- implementation. :- type table_cells ---> table_cells(html). :- instance html(table_cells) where [ html(table_cells(M)) = M ]. %-----------------------------------------------------------------------------% th(M) = table_cells(opentag("th", html(M))). td(M) = table_cells(opentag("td", html(M))). A >> table_cells(M) = table_cells(A >> M). table_cells(M1) ++ table_cells(M2) = table_cells(M1 ++ M2). nil = table_cells(text("")). %-----------------------------------------------------------------------------% %-----------------------------------------------------------------------------%