LaTeX 中的多列和多行 table?
Multi column and multi row table in LaTeX?
如何在 LaTeX 中绘制以下 table?里面的数据没那么重要
我写了下面的代码:
\begin{table}[H]
\centering
\begin{tabular}{cccccc}
\hline
\multicolumn{6}{|c|}{Feature Vector of Samples} \
\hline
\headerrow & 1 & 2 & 3 & 4 & 5\
1 & \(9.87*e^{-01}\) & \(8.67*e^{-17} \)& \(4.13*e^{-24}\) & \(1.16*e^{-17}\) & \(4.58*e^{-17}\) \
2 & \(1.16*e^{-16}\) & \(9.99*e^{-01}\) & \(9.14*e^{-25}\) & \(3.63*e^{-22}\) & \(2.69*e^{-11}\) \
3 & \(4.35*e^{-33}\) & \(7.85*e^{-34}\) & \(9.93*e^{-01}\) & \(3.74*e^{-04}\) & \(4.55*e^{-34}\) \
4 & \(5.51*e^{-26}\)& \(5.13*e^{-31}\)& \(5.02*e^{-04}\) & \(9.99*e^{-01}\) & \(1.71*e^{-29}\) \
5& \(9.60*e^{-18}\) & \(2.21*e^{-07}\)& \(2.52*e^{-25}\)& \(4.64*e^{-20}\)& \(9.99*e^{-01}\)
\end{tabular}
\caption{wasssss}
\label{tbl:wasss}
\end{table}
结果如下:
我需要添加的是一个多行,第一行不应该包括第一列。
理论上,您可以使用以下代码创建这样的 table,但请先查看 http://betterposters.blogspot.com/2012/08/the-data-prison.html,然后再对您的读者造成这样的 table
\documentclass{article}
\usepackage{graphicx}
\usepackage{multirow}
\begin{document}
\begin{table}[htbp]
\centering
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline
\multicolumn{2}{|c|}{} &\multicolumn{5}{|c|}{Feature Vector of Samples} \
\cline{3-7}
\multicolumn{2}{|c|}{} & 1 & 2 & 3 & 4 & 5\\hline
\multirow{5}{*}{\rotatebox{90}{samples}} & 1 & \(9.87*e^{-01}\) & \(8.67*e^{-17} \)& \(4.13*e^{-24}\) & \(1.16*e^{-17}\) & \(4.58*e^{-17}\) \\cline{2-7}
&2 & \(1.16*e^{-16}\) & \(9.99*e^{-01}\) & \(9.14*e^{-25}\) & \(3.63*e^{-22}\) & \(2.69*e^{-11}\) \\cline{2-7}
& 3 & \(4.35*e^{-33}\) & \(7.85*e^{-34}\) & \(9.93*e^{-01}\) & \(3.74*e^{-04}\) & \(4.55*e^{-34}\) \\cline{2-7}
& 4 & \(5.51*e^{-26}\)& \(5.13*e^{-31}\)& \(5.02*e^{-04}\) & \(9.99*e^{-01}\) & \(1.71*e^{-29}\) \ \cline{2-7}
& 5& \(9.60*e^{-18}\) & \(2.21*e^{-07}\)& \(2.52*e^{-25}\)& \(4.64*e^{-20}\)& \(9.99*e^{-01}\)\
\hline
\end{tabular}
\caption{wasssss}
\label{tbl:wasss}
\end{table}
\end{document}
你可以使用excel2latex。这是一个强大的表格写入工具。您需要在之后添加 packagins,就像在以下脚本中一样:
https://www.ctan.org/tex-archive/support/excel2latex
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{multirow} %for multirow
\usepackage{rotating} %for sideways, rotating "samples" at 90°"
\usepackage{bigstrut} %for bigstrut
\begin{document}
% Table generated by Excel2LaTeX from sheet 'Planilha1'
\begin{table}[htbp]
\centering
\caption{Add caption}
\begin{tabular}{|c|r|r|r|r|r|r|}
\hline
\multicolumn{2}{|c|}{\multirow{2}[4]{*}{}} & \multicolumn{5}{c|}{Feature Vector of Samples} \bigstrut\
\cline{3-7} \multicolumn{2}{|c|}{} & 1 & 2 & 3 & 4 & 5 \bigstrut\
\hline
\multirow{5}[10]{*}{\begin{sideways}samples\end{sideways}} & 1 & Value & Value & Value & Value & Value \bigstrut\
\cline{2-7} & 2 & Value & Value & Value & Value & Value \bigstrut\
\cline{2-7} & 3 & Value & Value & Value & Value & Value \bigstrut\
\cline{2-7} & 4 & Value & Value & Value & Value & Value \bigstrut\
\cline{2-7} & 5 & Value & Value & Value & Value & Value \bigstrut\
\hline
\end{tabular}%
\label{tab:addlabel}%
\end{table}%
\end{document}
如何在 LaTeX 中绘制以下 table?里面的数据没那么重要
我写了下面的代码:
\begin{table}[H]
\centering
\begin{tabular}{cccccc}
\hline
\multicolumn{6}{|c|}{Feature Vector of Samples} \
\hline
\headerrow & 1 & 2 & 3 & 4 & 5\
1 & \(9.87*e^{-01}\) & \(8.67*e^{-17} \)& \(4.13*e^{-24}\) & \(1.16*e^{-17}\) & \(4.58*e^{-17}\) \
2 & \(1.16*e^{-16}\) & \(9.99*e^{-01}\) & \(9.14*e^{-25}\) & \(3.63*e^{-22}\) & \(2.69*e^{-11}\) \
3 & \(4.35*e^{-33}\) & \(7.85*e^{-34}\) & \(9.93*e^{-01}\) & \(3.74*e^{-04}\) & \(4.55*e^{-34}\) \
4 & \(5.51*e^{-26}\)& \(5.13*e^{-31}\)& \(5.02*e^{-04}\) & \(9.99*e^{-01}\) & \(1.71*e^{-29}\) \
5& \(9.60*e^{-18}\) & \(2.21*e^{-07}\)& \(2.52*e^{-25}\)& \(4.64*e^{-20}\)& \(9.99*e^{-01}\)
\end{tabular}
\caption{wasssss}
\label{tbl:wasss}
\end{table}
结果如下:
我需要添加的是一个多行,第一行不应该包括第一列。
理论上,您可以使用以下代码创建这样的 table,但请先查看 http://betterposters.blogspot.com/2012/08/the-data-prison.html,然后再对您的读者造成这样的 table
\documentclass{article}
\usepackage{graphicx}
\usepackage{multirow}
\begin{document}
\begin{table}[htbp]
\centering
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline
\multicolumn{2}{|c|}{} &\multicolumn{5}{|c|}{Feature Vector of Samples} \
\cline{3-7}
\multicolumn{2}{|c|}{} & 1 & 2 & 3 & 4 & 5\\hline
\multirow{5}{*}{\rotatebox{90}{samples}} & 1 & \(9.87*e^{-01}\) & \(8.67*e^{-17} \)& \(4.13*e^{-24}\) & \(1.16*e^{-17}\) & \(4.58*e^{-17}\) \\cline{2-7}
&2 & \(1.16*e^{-16}\) & \(9.99*e^{-01}\) & \(9.14*e^{-25}\) & \(3.63*e^{-22}\) & \(2.69*e^{-11}\) \\cline{2-7}
& 3 & \(4.35*e^{-33}\) & \(7.85*e^{-34}\) & \(9.93*e^{-01}\) & \(3.74*e^{-04}\) & \(4.55*e^{-34}\) \\cline{2-7}
& 4 & \(5.51*e^{-26}\)& \(5.13*e^{-31}\)& \(5.02*e^{-04}\) & \(9.99*e^{-01}\) & \(1.71*e^{-29}\) \ \cline{2-7}
& 5& \(9.60*e^{-18}\) & \(2.21*e^{-07}\)& \(2.52*e^{-25}\)& \(4.64*e^{-20}\)& \(9.99*e^{-01}\)\
\hline
\end{tabular}
\caption{wasssss}
\label{tbl:wasss}
\end{table}
\end{document}
你可以使用excel2latex。这是一个强大的表格写入工具。您需要在之后添加 packagins,就像在以下脚本中一样:
https://www.ctan.org/tex-archive/support/excel2latex
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{multirow} %for multirow
\usepackage{rotating} %for sideways, rotating "samples" at 90°"
\usepackage{bigstrut} %for bigstrut
\begin{document}
% Table generated by Excel2LaTeX from sheet 'Planilha1'
\begin{table}[htbp]
\centering
\caption{Add caption}
\begin{tabular}{|c|r|r|r|r|r|r|}
\hline
\multicolumn{2}{|c|}{\multirow{2}[4]{*}{}} & \multicolumn{5}{c|}{Feature Vector of Samples} \bigstrut\
\cline{3-7} \multicolumn{2}{|c|}{} & 1 & 2 & 3 & 4 & 5 \bigstrut\
\hline
\multirow{5}[10]{*}{\begin{sideways}samples\end{sideways}} & 1 & Value & Value & Value & Value & Value \bigstrut\
\cline{2-7} & 2 & Value & Value & Value & Value & Value \bigstrut\
\cline{2-7} & 3 & Value & Value & Value & Value & Value \bigstrut\
\cline{2-7} & 4 & Value & Value & Value & Value & Value \bigstrut\
\cline{2-7} & 5 & Value & Value & Value & Value & Value \bigstrut\
\hline
\end{tabular}%
\label{tab:addlabel}%
\end{table}%
\end{document}