Macro Language Reference > PIs > Tables > <?tbrules>
  
<?tbrules>
Description
The <?tbrules> keyword is used to specify table rules. There are two forms of the command, each having several parameters that must be included.
The first form of the command configures the rule by firstly specifying the number of table rules required, then assigning a number to each rule and finally confirming the details for each rule. This is shown below:
<?tbrules=2(1, width,"color[;radius]","flags")(2,width,
"color[;radius]","flags")>
The second form of the <?tbrules> command uses the '+' symbol instead of num: use this form to add new table rules to an existing set of table rule properties:
<?tbrules=+(width,"color[;radius]","flags")(width,
"color[;radius]","flags")>
 
Example 426. Apply 3D rules to a table
The two examples below show how to create a 3D rule effect for a table:
<?tbrules=+(3mm,"80%","t/")(3mm,"90%","l/")(3mm,"55%","r/")
(3mm,"45%","b")>
<?tbrules=+(2mm,"none","tblr")>
<?tbbgc=70%>
1) Sets the rules and flags.
2) Gives a gap around the text.
3) Specifies a background colour.
These setting would give the result effect show in the image below:
<?tbrules=+(2mm,"80%;6mm","t1234/")(3mm,"90%","l/")
(3mm,"55%","r/")(1mm,"45%","b")>
<?tbrules=+(2mm,"none","tblr")>
<?tbbgc=70%>
1) Sets the rules and flags.
2) Gives a gap around the text.
3) Specifies a background colour.
These setting would give the result effect show in the image below:
 
Example 427. Set a table rule based on user defined line style
A table rule based on a user-defined line style can be applied, with the additional ability to include foreground and background colours. The example below will add a red rule of 3pt weight to the top and bottom of the table, based on the line style _li_shortdashes which consists of dashes separated by spaces. The blue background of the rule will fill in the spaces:
<?tbrules +(3pt, "red", "tb", 0, "none2, "blue", "_li
_shortdashes")>
Multiple rules of this type can also be defined:
<?tbrules +(2pt, "red", "tblr1234", 3mm, "none", "blue", "_li
_longdashes") (4pt, "none:3mm", "tblr1234") (2pt, "red",
"tblr1234", 3mm, "none", "blue", "_li_dotted")>
Patterns can also be used for the display of the start and end of rules. The example below draws a rule based on the _li_square1 line style, and bookends the line with the _le_diamond pattern:
<?tbrules +(3pt, "red", "lr", 0, "none", "green", "_li_square1",
"_le_diamond", "_le_diamond")>
Syntax
<?tbrules rulecount:n? ('(' ruleno:n? thickness:uh colour:c? flags:b? radius:um? fillcolour:c? bgcolour:c? start segment name:s? end segment name:s? cornerstyle:b ')' )+>
rulecount
If the first version of the command is used, this parameter specifies the total number of rules that are going to be defined in this command.
ruleno
If the first version of the command is used, this parameter specifies this particular rule's number, i.e. if it were the first in the list this would be 1 e.g.<?tbrules=2(1,...)(2,...)> shows you wish to define the first rule out of a set of 2.
thickness
The width of the rule and valid measurement unit, e.g. 5pt or 5mm
color
Color of the rule: can be any color name or type that is valid in APP,PTC ALD e.g. 50%, red or PANTONE_E_202-4_CVP (if loaded from a color book). Must be enclosed in double quotes.
To support existing files, if the foreground color had a semicolon followed by a number, this is interpreted as the radius field.
flags
The sides of the object that should contain the rule. Must be enclosed in double quotes.
t
Top
b
Bottom
l
Left
r
Right
1
Top left corner
2
Top right corner
3
Bottom left corner
4
Bottom right corner
u
Draw a diagonal rule from bottom left to top right.
d
Draw a diagonal rule from top left to bottom right.
p
Point the ends of the diagonal rule so they fit neatly into the corners of any outer rules.
c
Draw a rounded cap on the ends of the diagonal rules.
e
Instead of fitting the diagonal rule inside the bounding box, let them overlap so the middle of the rule ends will be exactly over the corners of the bounding box.
/
Merge two or more rules together, and split the corners between the rules, to create a 3D effect.
radius
The size of the corner rules.
fillcolor
Color of the fill within the rule definition: can be any color name or type that is valid in PTC ALD , e.g. 50%, red or PANTONE_E_202-4_CVP (if loaded from a color book). Must be enclosed in double quotes.
bgcolor
Color of the rule background: can be any color name or type that is valid in PTC ALD , e.g. 50%, red or PANTONE_E_202-4_CVP (if loaded from a color book). Must be enclosed in double quotes.
line name
The name of a particular used defined line style, created via the tlctrl macro. Must be enclosed in double quotes.
start segment name
The name of a particular user defined line segment to act as the end character for the line. Line segments are created via the tlsctrl macro. Must be enclosed in double quotes.
end segment name
The name of a particular user defined line segment to act as the start character for the line. Line segments are created via the tlsctrl macro. Must be enclosed in double quotes.
cornerstyle
The type of corner to be applied to the rule.
0
Rounded
1
Mitred (default)
2
Bevelled
Additional Information
Additional table rules options allow the application of rules based on user-defined line styles and patterns. For further information about user defined line styles, please refer to the macros tlctrl, tlpctrl and tlsctrl
Table rules count as displayable content and so prevent margin merging with margins for any nested content.
Related Links