Sample image
What all should I do to create a table as shown in the figure
Using something like \multirow
makes it very difficult for manually splitting the line
Using p{some cm}
in table leaves other columns with single entries unformatted, licking the top rule of the cell..
How can these entries be centered in the cells
Tried something like
\begin{table}[!h]
\begin{center}
\caption{Summary .....}
\begin{tabularx}{0.30\textwidth}{|c|X|X|X|}
\hlne
\textbf{Author} & \textbf{Lot size} & \textwidth{Inventory Cost Item} & \textwidth{Carbon Emission \& Enviornmentall Cost} \\
\hline
some text & some text & Order cost inventory holding cost & Carbon emission form logistic and wearhouse in linear in the order quantity \\ \hline
\end{table}
\end{center}
\end{tabularx}
Best Answer
The code you provided wasn't close to compilable: you had environments closing out of order, typos in commands, among other things.
Your question isn't totally clear, but I believe you're looking to vertically center the content of each row instead of having everything start at the top of the cell. You can achieve this with
which sets the
tabularx
X
column to use them
column type (vertically centered) instead of the defaultp
column type (top aligned).Other notes: don't use the
center
environment inside thetable
environment: this will add extra vertical spacing. Just putting\centering
inside thetable
environment is sufficient. But that's not necessary in my example below, since the table spans the full\textwidth
anyway.I also added
booktabs
commands to the example below for better spacing and appearance of the table, and set theX
columns\raggedright
since it's hard to do full justification well in this narrow a column width: