乳胶压痕/表格居中

发布于 2024-09-17 20:44:28 字数 1230 浏览 3 评论 0原文

是否可以使用 ctable 设置各行的居中,即使第 1 列前 3 行左居中,后 5 行右居中?

更具体地说,我希望此表中的male/female 和1..3 右对齐而不是左对齐,而其余变量名保持左居中。

\documentclass[12pt]{article}
\usepackage{relsize}
\usepackage{setspace}
\usepackage{ctable}
\usepackage{Sweave}
\usepackage{amsmath,amsfonts,amssymb}
\begin{document}
    \ctable[ caption={ compldich }, label=z, pos=!tbp, ]{lcc} {\tnote[***]{P$<$0.001}\tnote[**]{P$<$0.01}\tnote[*]{P$<$0.05}} {\FL\multicolumn{1}{l}{Variable}&\multicolumn{1}{c}{Univariate}&\multicolumn{1}{c}{Multivariate}\NN
    \multicolumn{1}{l}{}&\multicolumn{1}{c}{Odds ratio}&\multicolumn{1}{c}{Odds ratio }\NN
    \ML
    Prom&1.071&0.77\NN
    & (0.739,1.557) & (0.568,1.034) \NN
    \NN
    Ag&0.987&0.989***\NN
    & (0.97,1.004) & (0.983,0.995) \NN
    \NN
    Gend&&\NN
    Male&1&1\NN
    \NN
    Fema&1.195&1.153\NN
    & (0.606,2.388) & (0.863,1.538) \NN
    \NN
    HSSE&&\NN
    1&1&1\NN
    \NN
    2&0.562&0.685\NN
    & (0.113,2.259) & (0.454,1.029) \NN
    \NN
    3&0.007***&0.019***\NN
    & (0,0.058) & (0.004,0.054) \NN
    \NN
    \FL
    }
\end {document}

Is it possible to set the centering of the individual rows with ctable, ie so that column 1 has left centering for the first 3 rows and then right centering for the last 5 rows?

On a more specific note--I´d like male/female and 1..3 in this table to be right aligned instead of left aligned whilst the rest of the variablenames remain left centered.

\documentclass[12pt]{article}
\usepackage{relsize}
\usepackage{setspace}
\usepackage{ctable}
\usepackage{Sweave}
\usepackage{amsmath,amsfonts,amssymb}
\begin{document}
    \ctable[ caption={ compldich }, label=z, pos=!tbp, ]{lcc} {\tnote[***]{P
lt;$0.001}\tnote[**]{P
lt;$0.01}\tnote[*]{P
lt;$0.05}} {\FL\multicolumn{1}{l}{Variable}&\multicolumn{1}{c}{Univariate}&\multicolumn{1}{c}{Multivariate}\NN
    \multicolumn{1}{l}{}&\multicolumn{1}{c}{Odds ratio}&\multicolumn{1}{c}{Odds ratio }\NN
    \ML
    Prom&1.071&0.77\NN
    & (0.739,1.557) & (0.568,1.034) \NN
    \NN
    Ag&0.987&0.989***\NN
    & (0.97,1.004) & (0.983,0.995) \NN
    \NN
    Gend&&\NN
    Male&1&1\NN
    \NN
    Fema&1.195&1.153\NN
    & (0.606,2.388) & (0.863,1.538) \NN
    \NN
    HSSE&&\NN
    1&1&1\NN
    \NN
    2&0.562&0.685\NN
    & (0.113,2.259) & (0.454,1.029) \NN
    \NN
    3&0.007***&0.019***\NN
    & (0,0.058) & (0.004,0.054) \NN
    \NN
    \FL
    }
\end {document}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无所的.畏惧 2024-09-24 20:44:28

您可以尝试将相应的单元格放入框中,如下所示:

 Text & \ makebox [3 cm ][r]{ to the right } \NN

You could try putting the respective cells in a box like so:

 Text & \ makebox [3 cm ][r]{ to the right } \NN
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文