我有这个三角函数表:
它们的列正确地在中间对齐,但是行却没有。
那么,我怎样才能获得行中间对齐的文本?
工作示例如下:
\starttext
\midaligned{
\setupTABLE[c][each][align=middle, width=1.3cm]
\bTABLE
\bTR \bTD $\theta$ \eTD \bTD $0°$ \eTD \bTD $30°$ \eTD \bTD $45°$ \eTD \bTD $60°$ \eTD \bTD $90°$ \eTD \eTR
\bTR \bTD $sin(\theta)$ \eTD \bTD $0$ \eTD \bTD $\frac{1}{2}$ \eTD \bTD $\frac{\sqrt{2}}{2}$ \eTD \bTD $\frac{\sqrt{3}}{2}$ \eTD \bTD $1$ \eTD \eTR
\bTR \bTD $cos(\theta)$ \eTD \bTD $1$ \eTD \bTD $\frac{\sqrt{3}}{2}$ \eTD \bTD $\frac{\sqrt{2}}{2}$ \eTD \bTD $\frac{1}{2}$ \eTD \bTD $0$ \eTD \eTR
\bTR \bTD $tan(\theta)$ \eTD \bTD $0$ \eTD \bTD $\frac{\sqrt{3}}{3}$ \eTD \bTD $1$ \eTD \bTD $\sqrt{3}$ \eTD \bTD $\infty$ \eTD \eTR
\eTABLE
}
\stoptext
答案1
low
您可以使用、lohi
和high
关键字来控制单元格内容的垂直对齐方式align
。
\starttext
\startlinealignment[middle]
\bTABLE[width=2cm,height=2cm,align={middle,lohi}]
\bTR
\bTD \eTD
\bTD left \eTD
\bTD middle \eTD
\bTD right \eTD
\eTR
\bTR
\bTD low \eTD
\bTD[align={flushleft,low}] TEXT \eTD
\bTD[align={middle,low}] TEXT \eTD
\bTD[align={flushright,low}] TEXT \eTD
\eTR
\bTR
\bTD middle \eTD
\bTD[align={flushleft,lohi}] TEXT \eTD
\bTD[align={middle,lohi}] TEXT \eTD
\bTD[align={flushright,lohi}] TEXT \eTD
\eTR
\bTR
\bTD high \eTD
\bTD[align={flushleft,high}] TEXT \eTD
\bTD[align={middle,high}] TEXT \eTD
\bTD[align={flushright,high}] TEXT \eTD
\eTR
\eTABLE
\stoplinealignment
\stoptext