Subject: Draft table spec
From: Jeffry Smith (smith@missioncriticallinux.com)
Date: Tue Jan 16 2001 - 16:43:14 CST
Having spent a while looking at LaTeX, XHTML, OpenOffice, and KWord (and 
teaching myself a little about XML), I've drafted up a starting point for 
tables in the abiword DTD (I think).  It's below.  The main source was the 
XHTML spec, as it seemed to cover most of what I could think of, but I added 
the concept of a floating frame below it.  This is a frame that is attached to 
either a page or paragraph point, and has a given offset.
I know there's a lot more to add, I thought to start with some basics that can 
be expanded.
Main differences from XHTML:
1.  all of the various things measured in pixels/percent (border, width, etc) 
now have a new element, units.  This is the measurement for the item (mm, 
inches, pixels, etc).  I don't know fully about this, but it seemed to me that 
using pixels or percent only didn't work for paper.  Maybe percent only would 
work, and the renderer would translate.
2.  Added width & height elements to cells.  This allows cells to be 
non-standard sizes.
3.  Added a REPEAT element to colgroups, thead, and tbody.  This is a binary 
element that indicates whether the element is repeated across pages or not 
("0" means don't repeat, "1" means repeat).
4.  Dropped the <th> element in the <tr>.  Specify with a colgroup, instead 
(if we want to allow single cells to be headers, I suppose it could be added 
back in).
I left the col & colgroup in, but I think it should be possible to drop the 
col element, and use a colgroup with a span of 1 to accomplish the same thing. 
 This would tighten it up.
Comments/suggestions?
jeff
<!--======================= Tables =================-->
<!-- Derived from W3C XHTML table standard, -->
<!--
 The border attribute sets the thickness of the frame around the
 table. The default units are screen pixels.
 The frame attribute specifies which parts of the frame around
 the table should be rendered. The values are not the same as
 CALS to avoid a name clash with the valign attribute.
-->
<!ENTITY % TFrame ?(void|above|below|hsides|lhs|rhs|vsides|box|border)">
<!--
 The rules attribute defines which rules to draw between cells:
 If rules is absent then assume:
     ?none? if border is absent or border=?0" otherwise ?all?
-->
<!ENTITY % TRules ?(none | groups | rows | cols | all)">
  
<!-- horizontal placement of table relative to document -->
<!ENTITY % TAlign ?(left|center|right)">
<!-- horizontal alignment attributes for cell contents
  char        alignment char, e.g. char=?:?
  charoff     offset for alignment char
-->
<!ENTITY % cellhalign
  ?align      (left|center|right|justify|char) #IMPLIED
   char       %Character;    #IMPLIED
   charoff    %Length;       #IMPLIED?
  >
<!-- vertical alignment attributes for cell contents -->
<!ENTITY % cellvalign
  ?valign     (top|middle|bottom|baseline) #IMPLIED?
  >
<!-- type of  units used in measurements -->
<!ENTITY % units
  ?units      (pixels|mm|inch|pica|point) #IMPLIED?
  >
<!-- repeat of thead, tfoot, colgroup, or col.  States whether the entity is 
repeated or not  on additional pages.  1 = true, 0 = false
-->
<!ENTITY % repeat (1|0)  >
<!ELEMENT table
     (caption?, (col*|colgroup*), thead?, tfoot?, (tbody+|tr+))>
<!ELEMENT caption  %Inline;>
<!ELEMENT thead    (tr)+>
<!ELEMENT tfoot    (tr)+>
<!ELEMENT tbody    (tr)+>
<!ELEMENT colgroup (col)*>
<!ELEMENT col      EMPTY>
<!ELEMENT tr       (th|td)+>
<!ELEMENT td       %Flow;>
<!ATTLIST table
  %attrs;
  summary     %Text;         #IMPLIED
  width       %Length;       #IMPLIED
   wunits      %units;	#IMPLIED
  border      %Pixels;       #IMPLIED
   bunits      %units;	#IMPLIED
  frame       %TFrame;       #IMPLIED
  rules       %TRules;       #IMPLIED
  cellspacing %Length;       #IMPLIED
   csunits      %units;	#IMPLIED
  cellpadding %Length;       #IMPLIED
   cpunits      %units;	#IMPLIED>
<!ENTITY % CAlign ?(top|bottom|left|right)">
<!ATTLIST caption
  %attrs;
  >
<!--
colgroup groups a set of col elements. It allows you to group
several semantically related columns together.
-->
<!ATTLIST colgroup
  %attrs;
  span        %Number;       "1"
  width       %MultiLength;  #IMPLIED
   wunits      %units;	#IMPLIED
  %repeat;
  %cellhalign;
  %cellvalign;
  >
<!--
 col elements define the alignment properties for cells in
 one or more columns.
 The width attribute specifies the width of the columns, e.g.
     width=64        
     wunits specifies the units the width is measured in 
   
 The span attribute causes the attributes of one
 col element to apply to more than one column.
-->
<!ATTLIST col
  %attrs;
  span        %Number;       "1"
  width       %MultiLength;  #IMPLIED
   wunits      %units;	#IMPLIED
  %repeat;
  %cellhalign;
  %cellvalign;
  >
<!--
    Use thead to duplicate headers when breaking table
    across page boundaries, or for static headers when
    tbody sections are rendered in scrolling panel.
    Use tfoot to duplicate footers when breaking table
    across page boundaries, or for static footers when
    tbody sections are rendered in scrolling panel.
    Use multiple tbody sections when rules are needed
    between groups of table rows.
-->
<!ATTLIST thead
  %attrs;
  %cellhalign;
  %cellvalign;
  %repeat;
  >
<!ATTLIST tfoot
  %attrs;
  %cellhalign;
  %cellvalign;
  %repeat; 
 >
<!ATTLIST tbody
  %attrs;
  %cellhalign;
  %cellvalign;
  >
<!ATTLIST tr
  %attrs;
  %cellhalign;
  %cellvalign;
  >
<!-- Scope is simpler than headers attribute for common tables -->
<!ENTITY % Scope ?(row|col|rowgroup|colgroup)">
<!-- td for data  -->
<!ATTLIST td
  %attrs;
  abbr        %Text;         #IMPLIED
  axis        CDATA          #IMPLIED
  headers     IDREFS         #IMPLIED
  scope       %Scope;        #IMPLIED
  rowspan     %Number;       "1"
  colspan     %Number;       "1"
   width	      %Length	#IMPLIED
   wunits      %units;	#IMPLIED
   height      %Length	#IMPLIED
   hunits      %units;	#IMPLIED
  %cellhalign;
  %cellvalign;
  >
<!--======================= Floating Frames =================-->
<!-- Concept Derived from TeX, to define a table anchored to page or  -->
<!-- paragraph  --->
<!--
 The border attribute sets the thickness of the frame around the
floating frame. The default units are screen pixels.
 The frame attribute specifies which parts of the frame around
 the floating frame should be rendered. The values are not the same as
 CALS to avoid a name clash with the valign attribute.
-->
<!ENTITY % FAnchor ?(page | para)">
<!ELEMENT FFrame
     (caption?, (fbody)>
<!ELEMENT caption  %Inline;>
<!ATTLIST tbody
  %attrs;
  %Fhalign;
  %Fvalign;
  >
<!-- vertical alignment attributes for floating frame contents -->
<!ENTITY % Fhalign
   align      (left|center|right) #IMPLIED
   voffset       %Length;    #IMPLIED
   vunits	    %units	         #IMPLIED
   hoffset    %Length;       #IMPLIED
   hunits       %units          #IMPLIED
  >
<!-- vertical alignment attributes for floating frame contents -->
<!ENTITY % Fvalign
  ?valign     (top|middle|bottom|baseline) #IMPLIED
  >
This archive was generated by hypermail 2b25 : Tue Jan 16 2001 - 16:43:21 CST