1 #LyX 1.3 created this file. For more info see http://www.lyx.org/
6 \newcolumntype{d}[1]{D{.}{.}{#1}}
12 \paperfontsize default
19 \use_numerical_citations 0
20 \paperorientation portrait
23 \paragraph_separation indent
25 \quotes_language english
29 \paperpagestyle default
33 A Better Decimal-Alignment Solution
36 An alternative way to have decimal alignment in tables is through the dcolumn
38 Add the following to the LateX preamble:
48 newcolumntype{d}[1]{D{.}{.}{#1}}
51 To have a column decimally aligned, enter in the
53 Special Column Alignment
62 d{number of decimals of the data}
65 In the following table we entered
71 \added_space_top 0.3cm \added_space_bottom 0.3cm \align center
74 <lyxtabular version="3" rows="5" columns="2">
76 <column alignment="center" valignment="top" width="0pt">
77 <column alignment="right" valignment="top" leftline="true" width="0pt" special="d{4}">
78 <row bottomline="true">
79 <cell alignment="center" valignment="top" topline="true" usebox="none">
87 <cell multicolumn="1" alignment="center" valignment="top" bottomline="true" leftline="true" usebox="none">
97 <cell alignment="center" valignment="top" topline="true" usebox="none">
104 <cell multicolumn="1" alignment="right" valignment="top" leftline="true" usebox="none">
114 <cell alignment="center" valignment="top" topline="true" usebox="none">
121 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
131 <cell alignment="center" valignment="top" topline="true" usebox="none">
138 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
148 <cell alignment="center" valignment="top" topline="true" usebox="none">
155 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
171 To create extra column space just increase the number of decimals in
176 Setting the multicolumn attribute for a single cell makes it insensitive
177 to the decimal alignment which comes in handy as well.
178 A drawback of this method is that math mode is not allowed in a column
179 with decimal alignment except if the multicolumn attribute is set.
182 This method offers the same flexibility as the
187 One could, for example, change the alignment separator, and have different
188 alignment separators for different columns by defining multiple column
189 types in the preamble.
190 The syntax is as follows:
193 D{inputsep}{outputsep}{decimal places}
196 The interested reader is directed towards the
200 package documentation for more details.