<?xml version="1.0" encoding="utf-8"?>
<section id="S__db2html-table"><title>DocBook to HTML - Tables</title>
  <remark>This needs lots of talk about CALS</remark>
  <variablelist><title>Templates</title><varlistentry><term><link linkend="T__db2html_row"><function>db2html.row</function></link></term><listitem><para>Creates a <literal>tr</literal> element for a <literal>row</literal> element</para></listitem></varlistentry><varlistentry><term><link linkend="T__db2html_entry"><function>db2html.entry</function></link></term><listitem><para>Creates a <literal>td</literal> element for an <literal>entry</literal> element</para></listitem></varlistentry><varlistentry><term><link linkend="T__db2html_entry_implicit"><function>db2html.entry.implicit</function></link></term><listitem><para>Creates an implicit <literal>td</literal> element to fill up unoccupied columns</para></listitem></varlistentry><varlistentry><term><link linkend="T__db2html_entry_colnum"><function>db2html.entry.colnum</function></link></term><listitem><para>Calculates the actual column number for an <literal>entry</literal> element</para></listitem></varlistentry><varlistentry><term><link linkend="T__db2html_colspec_colnum"><function>db2html.colspec.colnum</function></link></term><listitem><para>Calculates the column number for a <literal>colspec</literal> element</para></listitem></varlistentry><varlistentry><term><link linkend="T__db2html_entry_colspan"><function>db2html.entry.colspan</function></link></term><listitem><para>Calculates the <literal>colspan</literal> for an <literal>entry</literal> element</para></listitem></varlistentry><varlistentry><term><link linkend="T__db2html_spanstr"><function>db2html.spanstr</function></link></term><listitem><para>Generates a string specifying the row spans in effect</para></listitem></varlistentry><varlistentry><term><link linkend="T__db2html_spanstr_pop"><function>db2html.spanstr.pop</function></link></term><listitem><para>Calculates the remaining spans after an <literal>entry</literal> element</para></listitem></varlistentry></variablelist><refentry id="T__db2html_row"><indexterm><primary>db2html.row</primary></indexterm><refnamediv><refname><function>db2html.row</function></refname><refpurpose>Creates a <literal>tr</literal> element for a <literal>row</literal> element</refpurpose></refnamediv><refsection><title>Parameters</title><variablelist><varlistentry><term><parameter>row</parameter></term><listitem><para>The <literal>row</literal> element to process</para></listitem></varlistentry><varlistentry><term><parameter>colspecs</parameter></term><listitem><para>The <literal>colspec</literal> elements currently in scope</para></listitem></varlistentry><varlistentry><term><parameter>spanspecs</parameter></term><listitem><para>The <literal>spanspec</literal> elements currently in scope</para></listitem></varlistentry><varlistentry><term><parameter>colsep</parameter></term><listitem><para>Whether column separators are currently enabled</para></listitem></varlistentry><varlistentry><term><parameter>rowsep</parameter></term><listitem><para>Whether column separators are currently enabled</para></listitem></varlistentry><varlistentry><term><parameter>spanstr</parameter></term><listitem><para>The string representation of the row spans</para></listitem></varlistentry></variablelist></refsection><refsection><title>Description</title>
  <para>FIXME</para>
  </refsection></refentry><refentry id="T__db2html_entry"><indexterm><primary>db2html.entry</primary></indexterm><refnamediv><refname><function>db2html.entry</function></refname><refpurpose>Creates a <literal>td</literal> element for an <literal>entry</literal> element</refpurpose></refnamediv><refsection><title>Parameters</title><variablelist><varlistentry><term><parameter>entry</parameter></term><listitem><para>The <literal>entry</literal> element to process</para></listitem></varlistentry><varlistentry><term><parameter>colspecs</parameter></term><listitem><para>The <literal>colspec</literal> elements currently in scope</para></listitem></varlistentry><varlistentry><term><parameter>spanspecs</parameter></term><listitem><para>The <literal>spanspec</literal> elements currently in scope</para></listitem></varlistentry><varlistentry><term><parameter>colsep</parameter></term><listitem><para>Whether column separators are currently enabled</para></listitem></varlistentry><varlistentry><term><parameter>rowsep</parameter></term><listitem><para>Whether column separators are currently enabled</para></listitem></varlistentry><varlistentry><term><parameter>colpos</parameter></term><listitem><para>The output column position currently being considered</para></listitem></varlistentry><varlistentry><term><parameter>colnum</parameter></term><listitem><para>The actual column number of <parameter>entry</parameter></para></listitem></varlistentry><varlistentry><term><parameter>spanstr</parameter></term><listitem><para>The string representation of the row spans</para></listitem></varlistentry></variablelist></refsection><refsection><title>Description</title>
  <para>This template processes a single <literal>entry</literal> element and generates <literal>td</literal> elements
  as needed.  It then calls itself on the following <literal>entry</literal> element, adjusting
  parameters as necessary.  Under certain conditions, this template may not be
  able to output a <literal>td</literal> element immediately.  In these cases, it makes whatever
  adjustments are needed and calls itself or <function><link linkend="T__db2html_entry_implicit">db2html.entry.implicit</link></function> (which,
  in turn, calls this template again when it's finished).</para>
  <para>Three parameters are used to determine whether a <literal>td</literal> element can be output.
  The <parameter>spanstr</parameter> parameter provides infomation about row spans in effect from
  entries in previous rows; the <parameter>colpos</parameter> parameter specifies which column we
  would output to if we created a <literal>td</literal>; and the <parameter>colnum</parameter> parameter specifies
  which column this <literal>entry</literal> should be in, according to any relevant <literal>colspec</literal>
  or <literal>spanspec</literal> elemets.</para>
  <para>There are two conditions that cause this template not to output a <literal>td</literal> element
  immediately: if the <parameter>spanstr</parameter> parameter does not start with <literal>0:</literal>, and if the
  <parameter>colpos</parameter> parameter is less than the <parameter>colnum</parameter> parameter.</para>
  <para>The <parameter>spanstr</parameter> parameter specifies the row spans in effect from entries in
  previous rows.  As this template iterates over the <literal>entry</literal> elements, it strips
  off parts of <parameter>spanstr</parameter> so that only the parts relevant to the <literal>entry</literal> are
  present.  If <parameter>spanstr</parameter> does not start with <literal>0:</literal>, then an entry in a previous
  row occupies this column position.  In this case, that value is removed from
  <parameter>spanstr</parameter>, the <parameter>colpos</parameter> parameter is incremented, and <function><link linkend="T__db2html_entry">db2html.entry</link></function> is
  called again.  Additionally, since <function><link linkend="T__db2html_entry_colnum">db2html.entry.colnum</link></function> doesn't consider
  row spans, the <parameter>colnum</parameter> parameter may be incremented as well.</para>
  <para>If the <parameter>colpos</parameter> parameter is less than the <parameter>colnum</parameter> parameter, then the
  document has skipped entries by explicitly referencing a column.  This is
  allowed in CALS tables, but not in HTML.  To fill the blank spaces, we call
  <function><link linkend="T__db2html_entry_implicit">db2html.entry.implicit</link></function>, which outputs an empty <literal>td</literal> element spanning as
  many columns as necessary to fill in the blanks.  The <function><link linkend="T__db2html_entry_implicit">db2html.entry.implicit</link></function>
  template then calls this template again with appropriate parameter values.</para>
  <para>When this template is finally able to output a <literal>td</literal> element, it calculates
  appropriate values for the <literal>style</literal> and <literal>class</literal> attribute based on DocBook
  attributes on the <literal>entry</literal>, the relevant <literal>colspec</literal> or <literal>spanspec</literal>, and any
  relevant ancestor elements.  It then calls itself on the following <literal>entry</literal>
  element to output the next <literal>td</literal>.</para>
  </refsection></refentry><refentry id="T__db2html_entry_implicit"><indexterm><primary>db2html.entry.implicit</primary></indexterm><refnamediv><refname><function>db2html.entry.implicit</function></refname><refpurpose>Creates an implicit <literal>td</literal> element to fill up unoccupied columns</refpurpose></refnamediv><refsection><title>Parameters</title><variablelist><varlistentry><term><parameter>entry</parameter></term><listitem><para>The <literal>entry</literal> element currently being processed</para></listitem></varlistentry><varlistentry><term><parameter>colspecs</parameter></term><listitem><para>The <literal>colspec</literal> elements currently in scope</para></listitem></varlistentry><varlistentry><term><parameter>spanspecs</parameter></term><listitem><para>The <literal>spanspec</literal> elements currently in scope</para></listitem></varlistentry><varlistentry><term><parameter>colsep</parameter></term><listitem><para>Whether column separators are currently enabled</para></listitem></varlistentry><varlistentry><term><parameter>rowsep</parameter></term><listitem><para>Whether column separators are currently enabled</para></listitem></varlistentry><varlistentry><term><parameter>colpos</parameter></term><listitem><para>The output column position currently being considered</para></listitem></varlistentry><varlistentry><term><parameter>colnum</parameter></term><listitem><para>The actual column number of <parameter>entry</parameter></para></listitem></varlistentry><varlistentry><term><parameter>colspan</parameter></term><listitem><para>How many columns the implicit <literal>td</literal> currently spans</para></listitem></varlistentry><varlistentry><term><parameter>spanstr</parameter></term><listitem><para>The string representation of the row spans</para></listitem></varlistentry></variablelist></refsection><refsection><title>Description</title>
  <para>CALS tables in DocBook don't need to have <literal>entry</literal> elements for each column
  in each row, even when the column is not covered by a row-spanning entry from
  a previous row.  An <literal>entry</literal> can explicitly specify which column it's in, and
  any previous unfilled columns are considered blank.  Since HTML tables don't
  have this mechanism, we have to insert blank <literal>td</literal> elements to fill the gaps.</para>
  <para>When <function><link linkend="T__db2html_entry">db2html.entry</link></function> detects a blank entry, it will call this template with
  the approprite parameters.  This template then calls itself recursively, each
  time adjusting the <parameter>colpos</parameter>, <parameter>colspan</parameter>, and <parameter>spanstr</parameter> parameters, until it
  comes across the last column that needs to be filled.  It then outputs a <literal>td</literal>
  element with an appropriate <literal>colspan</literal> attribute.</para>
  <para>Finally, this template calls <function><link linkend="T__db2html_entry">db2html.entry</link></function> again on <parameter>entry</parameter>.  With the
  values of <parameter>colpos</parameter> and <parameter>spanstr</parameter> suitably adjusted, that template is then
  able to output the <literal>td</literal> for the <literal>entry</literal> element.</para>
  </refsection></refentry><refentry id="T__db2html_entry_colnum"><indexterm><primary>db2html.entry.colnum</primary></indexterm><refnamediv><refname><function>db2html.entry.colnum</function></refname><refpurpose>Calculates the actual column number for an <literal>entry</literal> element</refpurpose></refnamediv><refsection><title>Parameters</title><variablelist><varlistentry><term><parameter>entry</parameter></term><listitem><para>The <literal>entry</literal> element to process</para></listitem></varlistentry><varlistentry><term><parameter>colspecs</parameter></term><listitem><para>The <literal>colspec</literal> elements currently in scope</para></listitem></varlistentry><varlistentry><term><parameter>spanspecs</parameter></term><listitem><para>The <literal>spanspec</literal> elements currently in scope</para></listitem></varlistentry><varlistentry><term><parameter>colpos</parameter></term><listitem><para>The column position, as passed by the preceding <literal>entry</literal></para></listitem></varlistentry></variablelist></refsection><refsection><title>Description</title>
  <para>FIXME</para>
  </refsection></refentry><refentry id="T__db2html_colspec_colnum"><indexterm><primary>db2html.colspec.colnum</primary></indexterm><refnamediv><refname><function>db2html.colspec.colnum</function></refname><refpurpose>Calculates the column number for a <literal>colspec</literal> element</refpurpose></refnamediv><refsection><title>Parameters</title><variablelist><varlistentry><term><parameter>colspec</parameter></term><listitem><para>The <literal>colspec</literal> element to process</para></listitem></varlistentry><varlistentry><term><parameter>colspecs</parameter></term><listitem><para>The <literal>colspec</literal> elements currently in scope</para></listitem></varlistentry><varlistentry><term><parameter>spanspecs</parameter></term><listitem><para>The <literal>spanspec</literal> elements currently in scope</para></listitem></varlistentry></variablelist></refsection><refsection><title>Description</title>
  <para>FIXME</para>
  </refsection></refentry><refentry id="T__db2html_entry_colspan"><indexterm><primary>db2html.entry.colspan</primary></indexterm><refnamediv><refname><function>db2html.entry.colspan</function></refname><refpurpose>Calculates the <literal>colspan</literal> for an <literal>entry</literal> element</refpurpose></refnamediv><refsection><title>Parameters</title><variablelist><varlistentry><term><parameter>entry</parameter></term><listitem><para>The <literal>entry</literal> element to process</para></listitem></varlistentry><varlistentry><term><parameter>colspecs</parameter></term><listitem><para>The <literal>colspec</literal> elements currently in scope</para></listitem></varlistentry><varlistentry><term><parameter>spanspecs</parameter></term><listitem><para>The <literal>spanspec</literal> elements currently in scope</para></listitem></varlistentry></variablelist></refsection><refsection><title>Description</title>
  <para>This template calculates how many columns an <literal>entry</literal> element should span.
  In CALS tables, column spanning is done by specifying starting and ending
  <literal>colspec</literal> elements, or by specifying a <literal>spanspec</literal> element which specifies
  starting and ending <literal>colspec</literal> elements.</para>
  </refsection></refentry><refentry id="T__db2html_spanstr"><indexterm><primary>db2html.spanstr</primary></indexterm><refnamediv><refname><function>db2html.spanstr</function></refname><refpurpose>Generates a string specifying the row spans in effect</refpurpose></refnamediv><refsection><title>Parameters</title><variablelist><varlistentry><term><parameter>colspecs</parameter></term><listitem><para>The <literal>colspec</literal> elements currently in scope</para></listitem></varlistentry><varlistentry><term><parameter>spanspecs</parameter></term><listitem><para>The <literal>spanspec</literal> elements currently in scope</para></listitem></varlistentry><varlistentry><term><parameter>spanstr</parameter></term><listitem><para>The <parameter>spanstr</parameter> parameter used by the previous row</para></listitem></varlistentry></variablelist></refsection><refsection><title>Description</title>
  <remark>This template needs to be explained in detail, but I forgot how it works.</remark>
  </refsection></refentry><refentry id="T__db2html_spanstr_pop"><indexterm><primary>db2html.spanstr.pop</primary></indexterm><refnamediv><refname><function>db2html.spanstr.pop</function></refname><refpurpose>Calculates the remaining spans after an <literal>entry</literal> element</refpurpose></refnamediv><refsection><title>Parameters</title><variablelist><varlistentry><term><parameter>colspecs</parameter></term><listitem><para>The <literal>colspec</literal> elements currently in scope</para></listitem></varlistentry><varlistentry><term><parameter>spanspecs</parameter></term><listitem><para>The <literal>spanspec</literal> elements currently in scope</para></listitem></varlistentry><varlistentry><term><parameter>colspan</parameter></term><listitem><para>The number of columns to pop</para></listitem></varlistentry><varlistentry><term><parameter>spanstr</parameter></term><listitem><para>The string representation of the column spans</para></listitem></varlistentry></variablelist></refsection><refsection><title>Description</title>
  <remark>This template needs to be explained in detail, but I forgot how it works.</remark>
  </refsection></refentry></section>
