\usepackage{multirow}
\begin{table}[htbp]
\begin{tabular}{p{2.5cm}p{2.5cm}p{1.5cm}p{6.5cm}}
\hline
\multicolumn{2}{c}{\textbf{Parameters}}                       & \multirow{2}{*}{\textbf{Used value}} & \multicolumn{1}{c}{\multirow{2}{*}{\textbf{Definition}}}                                                                                                                                 \\
\textbf{Original}             & \textbf{English translation}  &                                      & \multicolumn{1}{c}{}                                                                                                                                                                     \\
\hline
Rechenlauf fortsetzen         & Continue calculation          & No                                   & It determines whether a calculation run is to be continued. If yes, the result data from the file HYDRO\_AS 2D.CPR is transferred to the program and used as initial boundary condition. \\
Simulationszeit {[}s{]}       & Simulation time {[}s{]}       & 86400                                & It defines the simulation time in seconds                                                                                                                                                \\
Zeitintervall SMS {[}s{]}     & Time interval SMS {[}s{]}     & 8640                                 & It defines the time interval (in seconds) for the storage of area-based result data which can be visualized with the SMS program following the calculations.                             \\
Zeitintervall Q\_Strg {[}s{]} & Time interval Q\_Strg {[}s{]} & 900                                  & It defines the time interval (in seconds) for which the data of the node strings are written to the Q\_Strg.dat.                                                                         \\
Hmin                          & \multirow{5}{*}{}             & 0.01 m                               & Minimum water depth                                                                                                                                                                      \\
VELMAX                        &                               & 15 m/s                               & Maximum velocity allowed                                                                                                                                                                 \\
Amin                          &                               & 1.e-15 m\textsuperscript{2}                            & Minimum element size allowed for calculating the internal calculation time step                                                                                                          \\
CMUVISC                       &                               & 0.60                                 & Coefficient cm in the viscosity formula                                                                                                                                                  \\
SCF                           &                               & 1.00                                 & Coefficient for the additional acceleration of the calculation process       \\
\hline                                                                                                           
\end{tabular}
\end{table}

enter image description here

  • I would put "used value" on two lines. – Jay Nov 13 at 13:04
up vote 13 down vote accepted

A few points:

  • use booktabs package for better spacing

  • use siunitx package to get the space between values and units right

  • use a tabularx to keep the table within the available textwidth, yours was much wider

  • subdivide the middle rule

  • your parameters seems to be the names of some variables? I'd write them either in typewriter font or in small caps.

  • left align the columns. Justified text in very narrow columns will never look good

  • you mix if the unit is part of the parameter name of used value. I don't know your program, so no idea what is the correct way, but be consistent

  • make the content of the table and the rules aligned by using @{}


\documentclass{article}

\usepackage{geometry}
\usepackage{booktabs}
\usepackage{array}
\usepackage{multirow}
\usepackage{tabularx}
\usepackage{siunitx}


\newcolumntype{L}[1]{>{\centering\raggedright}m{#1}}

\begin{document}


\begin{table}[htbp]
\renewcommand{\arraystretch}{1.5}
\begin{tabularx}{\linewidth}{@{}L{2.5cm}L{2.5cm}L{1.5cm}X@{}}
\toprule
\multicolumn{2}{c}{\textbf{Parameters\hspace{1em}}} & & \\
\textbf{Original} & \textbf{English translation} & \textbf{Used value} & \textbf{Definition} \\

\cmidrule(r){1-2} \cmidrule(lr){3-3} \cmidrule(l){4-4}

Rechenlauf fortsetzen & Continue calculation & No & It determines whether a calculation run is to be continued. If yes, the result data from the file \texttt{HYDRO\_AS 2D.CPR} is transferred to the program and used as initial boundary condition. \\

Simulationszeit & Simulation time & \SI{86400}{s} & It defines the simulation time in seconds \\

Zeitintervall \texttt{SMS} & Time interval \texttt{SMS} & \SI{8640}{s} & It defines the time interval (in seconds) for the storage of area-based result data which can be visualized with the \texttt{SMS} program following the calculations. \\

Zeitintervall \texttt{Q\_Strg} & Time interval \texttt{Q\_Strg} & \SI{900}{s} & It defines the time interval (in seconds) for which the data of the node strings are written to the \texttt{Q\_Strg.dat}. \\

Hmin & \multirow{5}{*}{} & \SI{0.01}{m} & Minimum water depth \\

\texttt{VELMAX} & & \SI{15}{m/s} & Maximum velocity allowed \\

Amin & & \SI{e-15}{\meter\square} & Minimum element size allowed for calculating the internal calculation time step \\

\texttt{CMUVISC} & & 0.60 & Coefficient cm in the viscosity formula \\

\texttt{SCF} & & 1.00 & Coefficient for the additional acceleration of the calculation process \\
\bottomrule 
\end{tabularx}
\end{table}

\end{document}

enter image description here

  • 3
    Personally I would put also a \cmidrule to "Parameters". – Fran Nov 13 at 13:23
  • Could longtable be also used for this table? Could it be split in case it's too long using longtable and \pagebreak? – Bobolo Nov 27 at 23:29
  • @Bobolo Sure, just like the answer you got in tex.stackexchange.com/a/461892/36296 – samcarter Nov 28 at 9:29
  • It did not work, that is why I asked. I thought you might know better as this table is created by you. – Bobolo Nov 28 at 14:41
  • 1
    @Bobolo If I fix the error about the missing definition of \textdegree tex.stackexchange.com/a/461892/36296 works fine. (but I strongly suggest to use siunitx for numbers/units, otherwise the spacing will be wrong) – samcarter Nov 28 at 14:50

Here's a solution that's very similar to the one posted by @samcarter. E.g., it uses a tabularx environment, doesn't fully justify the cell contents, and uses the macros num, \si, and \SI of the siunitx package to display numbers, scientific units, and combinations of numbers and associated units.

Some differences:

  • No line breaks allowed in column 3
  • Automatic hanging indentation of cell contents in columns 1 and 2
  • No bold-facing of header cells
  • Terser language in column 4
  • Use \path macro (provided by url package) to typeset file names
  • Use of , (comma) as thousands-separator for numbers with 4 or more digits

enter image description here

\documentclass{article}
\usepackage[a4paper]{geometry} % set page parameters suitably
\usepackage[hyphens,spaces,obeyspaces]{url} % for '\path' macro
\usepackage{ragged2e,tabularx,booktabs,siunitx}
\newcolumntype{L}{>{\RaggedRight\arraybackslash}X}
\newcolumntype{P}[2]{>{\RaggedRight\hangafter=1\hangindent=1em}p{#1}}
\begin{document}
\begin{table}[htbp]
\sisetup{per-mode=symbol,
         tight-spacing,
         group-minimum-digits=4,
         group-separator={,}}
\begin{tabularx}{\textwidth}{@{} *{2}{P{2.2cm}}lL @{}}
\toprule
\multicolumn{2}{c}{Parameters} & Used value & Definition \\
\cmidrule(r){1-2}
Original & English translation \\
\midrule
Rechenlauf fortsetzen & Continue calculation & No & Determines whether a calculation run is to be continued. If yes, result data from the file \path{HYDRO_AS 2D.CPR} is transferred to program and used as initial boundary condition \\
Simulations\-zeit [\si{\second}] & Simulation time [\si{\second}] & \num{86400}  & Simulation time, in seconds \\
Zeitintervall SMS [\si{\second}]& Time interval SMS [\si{\second}] & \num{8640} & Time interval (in seconds) for storage of area-based result data which can be visualized with the SMS program following the calculations \\
Zeitintervall Q\_Strg [\si{\second}] & Time interval Q\_Strg [\si{\second}] & \num{900}  & Time interval (in seconds) for which the data of the node strings are written to \path{Q_Strg.dat} \\
Hmin               & & \SI{0.01}{\meter} & Minimum water depth \\
VELMAX             & & \SI{15}{\meter\per\second} & Maximum velocity allowed   \\
Amin               & & \SI{e-15}{\meter\squared} & Minimum element size allowed for calculating the internal calculation time step \\
CMUVISC            & & \num{0.60} & Coefficient cm in viscosity formula \\
SCF                & & \num{1.00} & Coefficient for  additional acceleration of calculation process \\
\bottomrule          
\end{tabularx}
\end{table}
\end{document}
  • 1
    Nice answer! The indention looks nice. Tiny problem: \path does not preserve the space within the file name (ok, file names should not have spaces, but ...) – samcarter Nov 13 at 13:51
  • 1
    @samcarter - Good catch about the space inside the file name! This issue can be remedied easily by adding the option obeyspaces when loading the url package. I'll update the answer accordingly. – Mico Nov 13 at 13:57

This is a slightly off-topic answer, in that others have covered the TeX aspects better than I could and I concentrate on the writing.

You can tighten up the wording of many of the entries in the last column. The "It" at the start of many entries is definitely superfluous. I'd also drop "determines" or "defines" and the "the". You can lose some other articles as well and generally copy-edit your text into a shorter form. I've had a go for you, see below. I may have overdone it in some cases but I still think the first entry is a little wordy. This saves a line on each of all but one of your multiline items, making the whole lot easier to read. Also you've got full stops on some entries but not others.

I'd also add a little vertical space between rows (the total height can still be less within the copy-editing), to make the last column easier to read . Use \raggedright to split lines between words rather than hyphenating I've used \raggedright for "Continue Calculation", but not for the teo cells starting "Time interval", to demonstrate the effect. These points are covered in other answers, as is the use of \texttt which I've inconsistently demonstrated.

In particular line breaks in variable names and the like should really be avoided

\def\arraystretch{1.5}%
\begin{table}[htbp]
\begin{tabular}{p{2.5cm}p{2.5cm}p{1.5cm}p{6.5cm}}
\hline
\multicolumn{2}{c}{\textbf{Parameters}}                       & \multirow{2}{*}{\textbf{Used value}} & \multicolumn{1}{c}{\multirow{2}{*}{\textbf{Definition}}}                                                                                                                                 \\
\textbf{Original}             & \textbf{English translation}  &                                      & \multicolumn{1}{c}{}                                                                                                                                                                     \\
\hline
Rechenlauf fortsetzen         & \raggedright Continue calculation          & No                     & Whether calculation run is to be continued. If yes, results from file \texttt{HYDRO\_AS 2D.CPR} are transferred to the program and used as initial condition. \\
Simulationszeit {[}s{]}       & Simulation time {[}s{]}       & 86400                                & Simulation time (in seconds)                                                                                                                                                \\
Zeitintervall SMS {[}s{]}     & Time interval SMS {[}s{]}     & 8640                                 & Time interval (in seconds) for storage of area-based results which can subsequently be visualized with the SMS program.                             \\
Zeitintervall Q\_Strg {[}s{]} & Time interval Q\_Strg {[}s{]} & 900                                  & Time interval (in seconds) for which  data of the node strings are written to \texttt{Q\_Strg.dat}.                                                                         \\
Hmin                          & \multirow{5}{*}{}             & 0.01 m                               & Minimum water depth                                                                                                                                                                      \\
VELMAX                        &                               & 15 m/s                               & Maximum velocity                                                                                                                                                                  \\
Amin                          &                               & 1.e-15 m\textsuperscript{2}          & Minimum element size for calculating internal calculation time step                                                                                                          \\
CMUVISC                       &                               & 0.60                                 & Coefficient cm in  viscosity formula                                                                                                                                                  \\
SCF                           &                               & 1.00                                 & Coefficient for  additional acceleration of  calculation process       \\
\hline                                                                                                           
\end{tabular}
\end{table}

Output

  • 1
    Can you think of a method for reducing the sizable inter-word gaps in the second column? – Mico Nov 13 at 15:38
  • 1
    @Mico more \raggedrights will do it -- I'll expand the answer. I prefer to use it locally so I can apply my own judgement as to which cells need it (rather than figuring out a way of making a column ragged -- another question) – Chris H Nov 13 at 15:45

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.