home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / APPS / lout2.lzh / LOUT2 / DOC / TR.TAB / s3 < prev    next >
Text File  |  1994-01-25  |  3KB  |  80 lines

  1. @Section
  2.    @Title { Changing the style of rows }
  3. @Begin
  4. @PP
  5. Sometimes different rows need different formats, usually because they
  6. are headings.  Although this can be done with style-changing symbols in
  7. the entries, it is probably better to use multiple format options:
  8. @ID @Code {
  9. "@Tab"
  10. "    @Fmta { @Col @Heading A  !  @Col @Heading B }"
  11. "    @Fmtb { @Col @A  !  @Col @CC B }"
  12. "{"
  13. "    @Rowa A { Course } B { Enrolment }"
  14. "    @Rowb A { Software Engineering } B { 174 }"
  15. "    @Rowb A { Complexity Theory } B { 37 }"
  16. "}"
  17. }
  18. has result
  19. @CD {
  20. @Tab
  21.     @Fmta { @Col @Heading A  !  @Col @Heading B }
  22.     @Fmtb { @Col A  !  @Col @CC B }
  23. {
  24.     @Rowa A { Course } B { Enrolment }
  25.     @Rowb A { Software Engineering } B { 174 }
  26.     @Rowb A { Complexity Theory } B { 37 }
  27. }
  28. }
  29. We have used the @Code "@Heading" symbol from the DocumentLayout package
  30. just to prove that it can be done.  Each row appears in the format of
  31. the corresponding format option:  @Code "@Rowa" rows in the format of
  32. {@Code "@Fmta"}, @Code "@Rowb" rows in the format of {@Code "@Fmtb"},
  33. and so on.  There may be up to ten different format options, from
  34. @Code "@Fmta" to {@Code "@Fmtj"}, and they may be used repeatedly and
  35. in any order.
  36. @PP
  37. There is an @Code "@Over" symbol for constructing
  38. {@I{spanning columns}}:  columns that spread over two or more following
  39. columns.  For example, the Lout input
  40. @ID @Code {
  41. "@I @Tab"
  42. "    @Fmta { @Col @CC X @Over A,B  !  @Col C }"
  43. "    @Fmtb { @Col A  !  @Col B  !  @Col C }"
  44. "{"
  45. "    @Rowa X { X } C { C }"
  46. "    @Rowb A { A } B { B } C { C }"
  47. "}"
  48. }
  49. produces the table
  50. @CD {
  51. @I @Tab
  52.     side { single }
  53.     @Fmta { @Col @CC X @Over A,B !! @Col C }
  54.     @Fmtb { @Col A !! @Col B !! @Col C }
  55. {
  56.     @Rowa X { X } C { C }
  57.        above { single }
  58.        below { single }
  59.     @Rowb A { A } B { B } C { C }
  60.        below { single }
  61. }
  62. }
  63. (We will see how to get the lines later.)  The @Code "@Over" symbol
  64. always comes directly after the column letter, and it is followed by one
  65. or more letters separated by commas indicating which columns in the
  66. following row this column is to span over.
  67. @PP
  68. With multiple row formats, especially those with spanning columns, it is
  69. important to take care that each row is compatible with the one
  70. preceding it, in the sense of having the same number of columns, taking
  71. @Code "@Over" symbols into account.  For example, two successive
  72. @Code "@Rowa" rows would not be compatible in the example above, since
  73. the second has only two columns but the first prepares the way for three.
  74. @PP
  75. Tab does not provide a way to have spanning columns underneath the columns
  76. they span, so spanning columns are useful only for headings.  This
  77. restriction was made necessary by inadequacies in the
  78. way that the Basser Lout interpreter handles spanning columns.
  79. @End @Section
  80.