I have a table and I want to set the table width to a specific value, say 0.8\columnwidth. After the stretching, I want each column's width is proportional to its actual width in the original table. After searching the tex.stackexchange.com, I find the posts about using the tabularx or the tabulary package to stretch the table width, but none of them achieve what I desire.
The former achieves something like this:
The new column width are all the same, not proportional to its actual width.
The result the tabulary package produces is like this:

There is no stretching effect in width.
The minimum working example is:
\documentclass[12pt]{article}
\usepackage{lipsum}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{tabulary}
\begin{document}
\lipsum[1]
% the original table
\begin{table}[h]
\begin{center}
\begin{tabular}{|c|c|c|}
\hline
first column & second column & third column \\
\hline
short & longer longer & longest longest longest \\
\hline
short & longer longer & longest longest longest \\
\hline
\end{tabular}
\end{center}
\end{table}
%table after using tabularx package
\lipsum[2]
\begin{table}[h]
\centering
\begin{tabularx}{\columnwidth}{|X|X|X|}
\hline
first column & second column & third column \\
\hline
short & longer longer & longest longest longest \\
\hline
short & longer longer & longest longest longest \\
\hline
\end{tabularx}
\end{table}
\lipsum[3]
% table after using tabulary
\begin{table}[h]
\begin{center}
\begin{tabulary}{\columnwidth}{|C|C|C|}
\hline
first column & second column & third column \\
\hline
short & longer longer & longest longest longest \\
\hline
short & longer longer & longest longest longest \\
\hline
\end{tabulary}
\end{center}
\end{table}
\end{document}
Is there anything wrong with my way using these two packages? or is there any other way to achieve what I want? Thank you in advance!
Xcolumn type can have a different width, with>{\hsize=x \hsize}X(the condition being the sum of the differentx\hsizes is equal to the number of X columns. However, you have to calculate the coefficients by hand – Bernard Oct 29 '16 at 15:40\textwidth. So I can not calculate the coefficients manually. How to do it? Could you please post an answer? – jdhao Oct 30 '16 at 07:41Xcolumns are typed in paragraph mode, which supposes their contents can spread over several lines. Will the cell contents always require only one line? Is there, say, a particular row which is representative of the widest contents of each column? – Bernard Oct 30 '16 at 12:34\textwidth. Under this condition, how to achieve the desired stretching? – jdhao Oct 30 '16 at 15:45