xhtml-table.rnc 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # Tables Module
  2. # This builds on the basic tables module, unlike with the DTD
  3. # implementation.
  4. include "xhtml-btable.rnc" {
  5. table =
  6. element table {
  7. table.attlist,
  8. caption?,
  9. (col* | colgroup*),
  10. ((thead?, tfoot?, tbody+) | tr+)
  11. }
  12. th = element th { th.attlist, Flow.model }
  13. td = element td { td.attlist, Flow.model }
  14. CellHAlign.attrib =
  15. attribute align {
  16. "left" | "center" | "right" | "justify" | "char"
  17. }?,
  18. attribute char { Character.datatype }?,
  19. attribute charoff { Length.datatype }?
  20. CellVAlign.attrib =
  21. attribute valign { "top" | "middle" | "bottom" | "baseline" }?
  22. scope.attrib =
  23. attribute scope { "row" | "col" | "rowgroup" | "colgroup" }?
  24. }
  25. table.attlist &=
  26. attribute width { Length.datatype }?,
  27. attribute border { Pixels.datatype }?,
  28. frame.attrib,
  29. rules.attrib,
  30. attribute cellspacing { Length.datatype }?,
  31. attribute cellpadding { Length.datatype }?
  32. col = element col { col.attlist }
  33. col.attlist =
  34. Common.attrib,
  35. attribute span { Number.datatype }?,
  36. attribute width { MultiLength.datatype }?,
  37. CellHAlign.attrib,
  38. CellVAlign.attrib
  39. colgroup = element colgroup { colgroup.attlist, col* }
  40. colgroup.attlist =
  41. Common.attrib,
  42. attribute span { Number.datatype }?,
  43. attribute width { MultiLength.datatype }?,
  44. CellHAlign.attrib,
  45. CellVAlign.attrib
  46. tbody = element tbody { tbody.attlist, tr+ }
  47. tbody.attlist = Common.attrib, CellHAlign.attrib, CellVAlign.attrib
  48. thead = element thead { thead.attlist, tr+ }
  49. thead.attlist = Common.attrib, CellHAlign.attrib, CellVAlign.attrib
  50. tfoot = element tfoot { tfoot.attlist, tr+ }
  51. tfoot.attlist = Common.attrib, CellHAlign.attrib, CellVAlign.attrib
  52. frame.attrib =
  53. attribute frame {
  54. "void"
  55. | "above"
  56. | "below"
  57. | "hsides"
  58. | "lhs"
  59. | "rhs"
  60. | "vsides"
  61. | "box"
  62. | "border"
  63. }?
  64. rules.attrib =
  65. attribute rules { "none" | "groups" | "rows" | "cols" | "all" }?