Estou tendo problemas com uma mesa.
Parece que não consigo alinhar minha tabela corretamente. O texto entre a segunda e a terceira linha deve estar alinhado; também o texto está muito próximo da barra superior. Existe uma solução fácil para esse problema?
\documentclass[a4paper]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[colorinlistoftodos]{todonotes}
\begin{document}
\begin{table*}[ht]\centering
\begin{tabular}{ l l l l l l l l } \hline
\ & \ & \ Yellow conidia & \ & \ & \ & Black conidia \ & \ \\ \hline
\ & Yield & Yield & OD Reference \ & \ & Yield & Yield & OD Reference \ \\
Run & (ng/uL) & ($\mu$g/g of conidia) & (260/280) & Run & (ng/uL) & ($\mu$g/g of conidia) & (260/280) \\ \hline
1 & 685 & 1370 & 2.04 & 1 & 377.5 & 754.9 & 1.98 \\
2 & 186.7 & 373.4 & 1.71 & 2 & 122.6 & 245.2 & 1.6 \\
3 & 314.1 & 628.2 & 1.81 & 3 & 387.2 & 774.4 & 2.04 \\
4 & 209.1 & 418.2 & 1.84 & 4 & 291.3 & 582.7 & 1.92 \\
5 & 724.3 & 1448.5 & 1.99 & 5 & 615.5 & 1231 & 1.99 \\
6 & 582.7 & 1165.3 & 1.74 & 6 & 337.4 & 674.9 & 2.09 \\
7 & 334.4 & 668.7 & 2.00 & 7 & 282 & 564 & 2.04 \\
8 & 126 & 252 & 2.13 & 8 & 92.8 & 185.6 & 1.99 \\
9 & 647.1 & 1294.2 & 1.95 & 9 & 507.6 & 1015.2 & 1.99 \\
10 & 964.4 & 1928.8 & 2.06 & 10 & 508 & 1016 & 1.87 \\
11 & 1033.9 & 2067.8 & 1.92 & 11 & 760.9 & 1521.8 & 1.92 \\
12 & 439 & 877.9 & 1.88 & 12 & 368.6 & 737.1 & 1.88 \\
13 & 1242.7 & 2485.4 & 1.88 & 13 & 911.2 & 1822.4 & 1.93 \\
14 & 1113 & 2226 & 1.82 & 14 & 283.7 & 567.4 & 1.56 \\
15 & 1081.7 & 2163.4 & 1.93 & 15 & 575.9 & 1151.8 & 1.92 \\
16 & 274.3 & 548.6 & 1.87 & 16 & 151.3 & 302.6 & 1.79 \\ \hline
\end{tabular}
\end{table*}
\end{document}
Responder1
ainda está um pouco cheio demais, mas...
\documentclass[fleqn,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{dcolumn,booktabs}
\begin{document}
\begin{table}\centering
\begin{tabular}{ *{2}{D..{2.0} D..{4.1} D..{4.1} D..{1.2}}}
\toprule
&
\multicolumn{3}{c}{Yellow conidia}&
\multicolumn{3}{c}{Black conidia} \\
\midrule
\multicolumn{1}{c}{Run} &
\multicolumn{1}{p{1.3cm}}{\centering Yield\\ (ng/uL)}&
\multicolumn{1}{p{1.3cm}}{\centering Yield\\ ($\mu$g/g of conidia)}&
\multicolumn{1}{p{1.3cm}}{\centering OD Reference \\ (260/280)}&
\multicolumn{1}{c}{Run} &
\multicolumn{1}{p{1.3cm}}{\centering Yield\\ (ng/uL)}&
\multicolumn{1}{p{1.3cm}}{\centering Yield\\ ($\mu$g/g of conidia)}&
\multicolumn{1}{p{1.3cm}}{\centering OD Reference \\ (260/280)}\\
\midrule
1 & 685 & 1370 & 2.04 & 1 & 377.5 & 754.9 & 1.98 \\
2 & 186.7 & 373.4 & 1.71 & 2 & 122.6 & 245.2 & 1.6 \\
3 & 314.1 & 628.2 & 1.81 & 3 & 387.2 & 774.4 & 2.04 \\
4 & 209.1 & 418.2 & 1.84 & 4 & 291.3 & 582.7 & 1.92 \\
5 & 724.3 & 1448.5 & 1.99 & 5 & 615.5 & 1231 & 1.99 \\
6 & 582.7 & 1165.3 & 1.74 & 6 & 337.4 & 674.9 & 2.09 \\
7 & 334.4 & 668.7 & 2.00 & 7 & 282 & 564 & 2.04 \\
8 & 126 & 252 & 2.13 & 8 & 92.8 & 185.6 & 1.99 \\
9 & 647.1 & 1294.2 & 1.95 & 9 & 507.6 & 1015.2 & 1.99 \\
10 & 964.4 & 1928.8 & 2.06 & 10 & 508 & 1016 & 1.87 \\\\
11 & 1033.9 & 2067.8 & 1.92 & 11 & 760.9 & 1521.8 & 1.92 \\
12 & 439 & 877.9 & 1.88 & 12 & 368.6 & 737.1 & 1.88 \\
13 & 1242.7 & 2485.4 & 1.88 & 13 & 911.2 & 1822.4 & 1.93 \\
14 & 1113 & 2226 & 1.82 & 14 & 283.7 & 567.4 & 1.56 \\
15 & 1081.7 & 2163.4 & 1.93 & 15 & 575.9 & 1151.8 & 1.92 \\
16 & 274.3 & 548.6 & 1.87 & 16 & 151.3 & 302.6 & 1.79 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
Responder2
Aqui está uma solução que usa (a) o S
tipo de coluna siunitx
para alinhar as entradas numéricas nos marcadores decimais, (b) a \si
macro (também do siunitx
pacote) para formatar as unidades e (c) o tabularx
pacote (e um formulário modificado do tipo de coluna daquele pacote X
para 6 dos 8 subcabeçalhos) para forçar a tabela a ocupar toda a largura (e não mais!) do bloco de texto. Por fim, as macros de desenho de regras do booktabs
pacote são utilizadas para obter um bom espaçamento em torno das linhas horizontais.
\documentclass[a4paper]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,booktabs}
\usepackage{siunitx}
\sisetup{per-mode=symbol}
\usepackage{tabularx,ragged2e}
\newcolumntype{C}{>{\Centering\arraybackslash}X} % centered form of "X" column type
\newcommand\mC[1]{\multicolumn{1}{C}{#1}} % handy shortcut macro
\begin{document}
\begin{table}[ht]
\setlength\tabcolsep{5pt} % default value: 6pt
\begin{tabularx}{\textwidth}{@{} *{2}{l *{2}{S[table-format=4.1]} S[table-format=1.2]} @{}}
\toprule
\multicolumn{4}{@{}c}{Yellow conidia} & \multicolumn{4}{c@{}}{Black conidia} \\
\cmidrule(r){1-4} \cmidrule(l){5-8}
%% use "C" column type for six of the eight header cells
Run & \mC{Yield (\si{\nano\gram\per\micro\liter})}
& \mC{Yield (\si{\micro\gram\per\gram} of conidia)}
& \mC{OD Reference (260/280)} &
Run & \mC{Yield (\si{\nano\gram\per\micro\liter})}
& \mC{Yield (\si{\micro\gram\per\gram} of conidia)}
& \mC{OD Reference (260/280)}\\
\midrule
1 & 685 & 1370 & 2.04 & 1 & 377.5 & 754.9 & 1.98 \\
2 & 186.7 & 373.4 & 1.71 & 2 & 122.6 & 245.2 & 1.6 \\
3 & 314.1 & 628.2 & 1.81 & 3 & 387.2 & 774.4 & 2.04 \\
4 & 209.1 & 418.2 & 1.84 & 4 & 291.3 & 582.7 & 1.92 \\
5 & 724.3 & 1448.5 & 1.99 & 5 & 615.5 & 1231 & 1.99 \\
6 & 582.7 & 1165.3 & 1.74 & 6 & 337.4 & 674.9 & 2.09 \\
7 & 334.4 & 668.7 & 2.00 & 7 & 282 & 564 & 2.04 \\
8 & 126 & 252 & 2.13 & 8 & 92.8 & 185.6 & 1.99 \\
9 & 647.1 & 1294.2 & 1.95 & 9 & 507.6 & 1015.2 & 1.99 \\
10 & 964.4 & 1928.8 & 2.06 & 10 & 508 & 1016 & 1.87 \\
11 & 1033.9 & 2067.8 & 1.92 & 11 & 760.9 & 1521.8 & 1.92 \\
12 & 439 & 877.9 & 1.88 & 12 & 368.6 & 737.1 & 1.88 \\
13 & 1242.7 & 2485.4 & 1.88 & 13 & 911.2 & 1822.4 & 1.93 \\
14 & 1113 & 2226 & 1.82 & 14 & 283.7 & 567.4 & 1.56 \\
15 & 1081.7 & 2163.4 & 1.93 & 15 & 575.9 & 1151.8 & 1.92 \\
16 & 274.3 & 548.6 & 1.87 & 16 & 151.3 & 302.6 & 1.79 \\
\bottomrule
\end{tabularx}
\end{table}
\end{document}