改进第二个表格,使其与第一个表格一样正确

改进第二个表格,使其与第一个表格一样正确

您能否帮助我使第二个表格正确无误(与第一个表格类似),另外,从两个表格中删除第一列(路线图)

第一张表:

\documentclass{article}
            \pagestyle{empty}
            \usepackage[paperheight=11in,paperwidth=7in, margin=0.5in,landscape]{geometry}
            \usepackage{tikz}
            \usepackage{array}
            \usepackage{makecell}
            \usepackage{color, colortbl}
            \usepackage{multirow}
            \usepackage{hhline}
            \usetikzlibrary{calc}

            \begin{document}
                    \begin{table}[]
                    \centering
                    \begin{tabular}{|l|l|l|l|}
                        \hline
                        \multirow{25.66}{*}{Roadmap} & \multirow{7.5}{*}{February} & \multirow{-2}{*}{Week1} &\makecell[l]{Installing the simulation environment \\ Adding the UR manipulator to the simulation environment \\ Getting familiar with the simulation environment(learning how to include and position simple objects cube, ball, etc.)}\\[-3ex] \cline{3-3}
                         & & Week2 \\ \cline{3-4}
                          & & Week3 & \makecell[l]{ Literature studies on grasping a cube and navigating between two waypoints\\ Documentation} \\ \cline{3-4}
                          & & \multirow{-2}{*}{Week4} & \makecell[l]{Literature studies on grasping a cube and navigating between (set of) waypoints\\ Coding the navigation towards the position of the object\\ Coding the grasp to the object\\ Coding the navigation of the grasped object from it's initial position towards pre-defined target waypoint\\ Documentation} \\[-3ex] \cline{2-3}
                          & \multirow{10}{*}{March} & Week1 & \\ \cline{3-4}
                          & & \multirow{-2}{*}{Week2}& \makecell[l]{ Literature studies on the cable implementation (reduced stiffness objects)\\ Implementing and Positioning the cable at a certain position in the workspace\\ Documentation} \\[-3ex]
                          \cline{3-3}
                           & & Week3 \\
                          \cline{3-4}
                          & & \multirow{-2}{*}{Week4} & \makecell[l]{Coding the grasp to the cable and conducting the navigation from the initial to goal waypoint\\ Confirming the no drop of the cable during the navigation\\ Documentation \\---\\ \textit{Note: The items in this field are started to be applied in a fixed manner (No machine learning model to be developed). }\\ \textit{In case the fixed manner isn't giving sufficient results, an RL model to be developed, the task to be extended more three weeks} \\\textit{and the shortest path planning task to be eliminated}} \\[-2.75ex] \cline{2-3}
                          & \multirow{5.5}{*}{April} & Week1 & \\ \cline{3-4}
                          & & Week2 & \makecell[l]{Literature studies on reinforcement learning\\ (Deep deterministic policy gradient and Deep Q-learning)\\ Documentation} \\[-2.8ex] \cline{3-3}
                          & & Week3 & \\ \cline{3-4}
                          & & \multirow{-2}{*}{Week4} & \makecell[l]{Developing a Reinforcement learning model to navigate the grasped cable to the predefined target waypoint\\ Documentation \\
                          ---\\ \textit{Note: For the grasping task, the code developed in the March's 4th week will be} used} \\[-2.8ex] \cline{2-3}
                          & May & Week1 & \\ \hline
                    \end{tabular}
                    \end{table}

第二张表:

\begin{table}[]
\begin{center}
\begin{tabular}{|l|l|l|l|}
\hline
\multirow{Roadmap} & \multirow{May}    & Week2 & \multirow{\begin{tabular}[c]{@{}l@{}}Inserting certain fixed object(s) to be considered as obstacle(s)\\ Reconstructing the reinforcement learning model\\ Retraining the reinforcement learning model\\ Documentation\end{tabular}} \\ \cline{3-3}
                          &                         & Week3 &                                                                                                                                                                                                                                            \\ \cline{3-4} 
                          &                         & Week4 & \multirow{\begin{tabular}[c]{@{}l@{}}Transforming the obstacles from fixed to dynamic\\ Reconstructing/Extending the reinforcement learning model\\ Retraining the reinforcement learning model\\ Documentation\end{tabular}}        \\ \cline{2-3}
                          & \multirow{June}   & Week1 &                                                                                                                                                                                                                                            \\ \cline{3-3}
                          &                         & Week2 &                                                                                                                                                                                                                                            \\ \cline{3-3}
                          &                         & Week3 &                                                                                                                                                                                                                                            \\ \cline{3-4} 
                          &                         & Week4 & \multirow{\begin{tabular}[c]{@{}l@{}}Literature studies on the shortest path planning and optimizing the energy consumption with reinforcement learning \\ Documentation\end{tabular}}                                               \\ \cline{2-3}
                          & \multirow{July}   & Week1 &                                                                                                                                                                                                                                            \\ \cline{3-4} 
                          &                         & Week2 & \multirow{Reconstructing/Extending the reinforcement learning model to include the shortest path following}                                                                                                                          \\ \cline{3-3}
                          &                         & Week3 &                                                                                                                                                                                                                                            \\ \cline{3-3}
                          &                         & Week4 &                                                                                                                                                                                                                                            \\ \cline{2-4} 
                          & \multirow{August} & Week1 & \multirow{Documentation and Finalization}                                                                                                                                                                                            \\ \cline{3-3}
                          &                         & Week2 &                                                                                                                                                                                                                                            \\ \cline{3-3}
                          &                         & Week3 &                                                                                                                                                                                                                                            \\ \cline{3-3}
                          &                         & Week4 &                                                                                                                                                                                                                                            \\ \hline
\end{tabular}
\end{center}
\end{table}
\end{document}

答案1

这是第二张表格的解决方案。如果您想将两个表格分组,则横向的纸张尺寸太小,或者您应该使用longtable跨页分割。

您应该明白,这multirow不是自动工作的,需要告诉它内容将分布在多少行上,以及它需要多大的宽度。使用* 宽度会使其使用内容的自然宽度。除此之外,我使用了\Shortunderstack命令来  stackengine获得更简单的代码。

\documentclass{article}
\pagestyle{empty}
\usepackage[paperheight=11in,paperwidth=7in, margin=0.5in,landscape]{geometry}
\usepackage{tikz}
\usepackage{array}
\usepackage{makecell}
\usepackage[usestackEOL]{stackengine} 
\usepackage{color, colortbl}
\usepackage{multirow}
\usepackage{hhline}
\usetikzlibrary{calc}

\begin{document}

    \begin{table}[]
    \centering
    \begin{tabular}{|l|l|l|l|}
    \hline
    \multirow{15}{*}{Roadmap} &\multirow{2}{*}{May} & \multirow{-2}{*}{Week2} & \makecell[l]{Inserting certain fixed object(s) to be considered as obstacle(s)\\ Reconstructing the reinforcement learning model\\ Retraining the reinforcement learning model\\ Documentation} \\[-2.8ex] \cline{3-3}
    & & Week3 & \\ \cline{3-4}
    & & Week4 & \smash{\Shortunderstack[l]{Transforming the obstacles from fixed to dynamic\\ Reconstructing/Extending the reinforcement learning model\\ Retraining the reinforcement learning model\\ Documentation}} \\ \cline{2-3}
    & \multirow{4}{*}{June} & Week1 & \\ \cline{3-3}
    & & Week2 & \\ \cline{3-3}
    & & Week3 & \\ \cline{3-4}
    & & Week4 & \smash{\Shortunderstack[l]{Literature studies on the shortest path planning and optimizing the energy consumption with reinforcement learning \\ Documentation}} \\ \cline{2-3}
    & \multirow{4}{*}{July} & Week1 & \\ \cline{3-4}
    & & Week2 & \\ cline{3-3}
    & & Week3 & Reconstructing/Extending the reinforcement learning model to include the shortest path following\\ \cline{3-3}
    & & Week4 & \\ \cline{2-4}
    & \multirow{4}{*}{August} & Week1 & \multirow{4}{*}{Documentation and Finalization} \\ \cline{3-3}
    & & Week2 & \\ \cline{3-3}
    & & Week3 & \\ \cline{3-3}
    & & Week4 & \\ \hline
    \end{tabular}
   \end{table}

 \end{document}

答案2

这是合并表的解决方案。使用了xltabular以下hhline包:

\documentclass{article}
\usepackage[paperheight=11in,paperwidth=7in, margin=0.5in,landscape]{geometry}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{array, makecell, multirow}
\usepackage{xltabular}  % <--- new
%\usepackage{bigstrut}
\usepackage{color, colortbl}
\usepackage{hhline}

\begin{document}
\pagestyle{empty}

\linespread{0.96}\selectfont
\begin{xltabular}{\linewidth}{|l|l|l|X|}
    \hhline{|----|}
\multirow{40}{*}{Roadmap} 
    & \multirow{9}{*}{February} 
        & \multirow{2}{*}{Week 1}
            &   Installing the simulation environment \par
                Adding the UR manipulator to the simulation environment \par 
                Getting familiar with the simulation environment(learning how to include and position simple objects cube, ball, etc.)
    \\[-2.4ex]    \hhline{|~~-~|}
    &   & Week 2
    \\          \hhline{|~~--|}
    &   & \multirow{2}{*}{Week 3}
            &   Literature studies on grasping a cube and navigating between two waypoints\par
                Documentation
    \\          \hhline{|~~--|}
    &   & \multirow{5}{*}{Week 4}
        &   Literature studies on grasping a cube and navigating between (set of) waypoints\par
            Coding the navigation towards the position of the object\par
            Coding the grasp to the object\par
            Coding the navigation of the grasped object from it's initial position towards pre-defined target waypoint\par
            Documentation
    \\[-2.4ex]    \hhline{|~--~|}
    & \multirow{11}{*}{March}
        & Week 1
            &
    \\          \hhline{|~~-~|}
    \cline{3-4}
    &   & \multirow{-2}{*}{Week 2}
            & \makecell[l]{Literature studies on the cable implementation (reduced stiffness objects)\\
            Implementing and Positioning the cable at a certain position in the workspace\\ Documentation}
    \\[-2.4ex]      \hhline{|~~-~|}
    &   & Week 3 &
    \\              \hhline{|~~--|}
    &   & \multirow{-2}{*}{Week 4}
            & \makecell[l]{Coding the grasp to the cable and conducting the navigation from the initial to goal waypoint\\
            Confirming the no drop of the cable during the navigation\\
            Documentation \\
            ---\\
            \textit{Note: The items in this field are started to be applied in a fixed manner (No machine learning model to be developed). }\\
            \textit{In case the fixed manner isn't giving sufficient results, an RL model to be developed, the task to be extended more three weeks} \\\textit{and the shortest path planning task to be eliminated}}
    \\[-2.4ex]     \hhline{|~--~|}
    & \multirow{8}{*}{April}
        & Week 1 &
    \\              \hhline{|~~--|}
    &   & \multirow{-2}{*}{Week 2}
            & \makecell[l]{Literature studies on reinforcement learning\\ (Deep deterministic policy gradient and Deep Q-learning)\\ Documentation}
    \\[-2.4ex]      \hhline{|~~-~|}
    &   & Week 3 &
    \\              \hhline{|~~--|}
    &   & \multirow{3}{*}{Week 4}
                &   Developing a Reinforcement learning model to navigate the grasped cable to the predefined target waypoint\par
                    Documentation \par
                    ---\par
                    \textit{Note: For the grasping task, the code developed in the March's 4th week will be} used
    \\[-2.4ex]      \hhline{|~--~|}
    & \multirow{6}{*}{May}
        & Week 1 &
    \\              \hhline{|~~--|}%\hline
    &   & \multirow{2}[1]{*}{Week 2}
                & \multirow{2}{=}{%
                    Inserting certain fixed object(s) to be considered as obstacle(s)\newline
                    Reconstructing the reinforcement learning model\newline
                    Retraining the reinforcement learning model\newline
                    Documentation}     
    \\[2.4ex]              \hhline{|~~-~|}%\hline
    &   & \multirow{2}[2]{*}[0.5ex]{Week 3}
            &
    \\[2.8ex]              \hhline{|~~--|}%\hline
    &   & Week 4    &   \multirow{3}{=}{%
                    Transforming the obstacles from fixed to dynamic\newline
                    Reconstructing/Extending the reinforcement learning model\newline
                    Retraining the reinforcement learning model\newline
                    Documentation}
    \\          \hhline{|~--~|}
    & \multirow{4}{*}{June}
        & Week 1 &
    \\          \hhline{|~~-~|}
    &   & Week 2 &
    \\          \hhline{|~~-~|}
    &   & Week 3 &                                                                                                                                                                                                                                            \\*          \hhline{|----|}
\multicolumn{4}{c}{}
   \\        \hhline{|----|}
\multirow{7}{*}{Roadmap}
    & June
        & Week 4    &                                             
    \\         \hhline{|~--~|}
    &   & Week 1 & \multirow{-2}{*}{%
                    Literature studies on the shortest path planning and optimizing the energy consumption with reinforcement learning \newline
                    Documentation} 
    \\*        \hhline{|~~--|}
    & \multirow{2}{*}{July}
        & Week 2 &   \multirow{3}{=}{%
                    Reconstructing/Extending the reinforcement learning model to include the shortest path following}
     \\        \hhline{|~~-~|}
    &   & Week 3 &                                                                                                                                                                                                                                            \\        \hhline{|~~-~|}
    &   & Week4 &                                                                                                                                                                                                                                            \\        \hhline{|~~-~|}
    & \multirow{4}{*}{August}
        & Week1 &   \multirow{4}{=}{Documentation and Finalization}                                                                                                                                                                                            \\        \hhline{|~~-~|}
    &   & Week2 &                                                                                                                                                                                                                                            \\        \hhline{|~~-~|}
    &   & Week3 &                                                                                                                                                                                                                                            \\        \hhline{|~~-~|}
    &   & Week4 &                                                                                                                                                                                                                                            \\        \hhline{|~~-~|}
    \end{xltabular}
\end{document}

相关内容