我正在尝试用乳胶重建这张表
到目前为止我已经设法得到了这个
使用这个:
\begin{table}[h]
\begin{table}[h]
\begin{tabular}{|l|l|p{10cm}|}
\hline
\multicolumn{3}{|c|}{\textbf{Daily Log}}\\ \hline
\multicolumn{2}{|l|}{Student Name: My Name} & Student Number: 9999999 \\ \hline
\multicolumn{3}{|l|}{Company Name: A Company Name - Some more text} \\ \hline
Day & Date & Activities \\ \hline
1 & 11/11/13 & A few sentences of text need to go here for every row from now on\\ \hline
2 & & \\ \hline
\end{tabular}
\end{table}
但是我无法让学生编号单元格移动而不影响活动单元格的大小。同样,我希望日期单元格尽可能小,但由于学生姓名单元格的大小,我无法做到这一点。所以实际上我想我真正想问的是,有没有办法逐行更改列的宽度?
答案1
您可以使用内部tabular
:
\documentclass{article}
\begin{document}
\begin{table}[h]
\begin{tabular}{|l|l|p{10cm}|}
\hline
\multicolumn{3}{|c|}{\textbf{Daily Log}}\\ \hline
\multicolumn{2}{|l}{Student Name: My Name} & %% note |l
%% from here
\multicolumn{1}{l|}{\begin{tabular}[t]{p{1in}|l} %% adjust 1in as you like
& Student Number: 9999999
\end{tabular}}\\\hline
%% till here
\multicolumn{3}{|l|}{Company Name: A Company Name - Some more text} \\ \hline
Day & Date & Activities \\ \hline
1 & 11/11/13 & A few sentences of text need to go here for every row from now on\\ \hline
2 & & \\ \hline
\end{tabular}%
\end{table}
\end{document}
由于表格太宽,我得到了错误的框。希望您在实际文档中已经正确调整了这一点。