Tabularx the width of the elastic column in a macro package \hsize

Source: Internet
Author: User

\documentclass{article}
\usepackage{amsmath}
\USEPACKAGE{AMSSYMB}
\usepackage{latexsym}
\USEPACKAGE{CJK}

\usepackage{tabularx}
\usepackage{array}

\newcommand{\preservebackslash}[1]{\let \temp =\\ #1 \let \ = \temp}
\newcolumntype{c}[1]{>{\preservebackslash\centering}p{#1}}
\newcolumntype{r}[1]{>{\preservebackslash\raggedleft}p{#1}}
\newcolumntype{l}[1]{>{\preservebackslash\raggedright}p{#1}}

\begin{document}
\begin{cjk*}{gbk}{song}
\cjktilde

\begin{tabularx}{10.5cm}{|p{3cm} |>{\setlength{\hsize}{.5\hsize}\centering}x |>{\setlength{\hsize}{1.5\ Hsize}}x|}
%\hsize is the column width that is automatically calculated, and the number preceding the \hsize in {. 5\hsize} and {1.5\hsize} must be equal to the number of elastic columns in the table. For this example, the Flex column has 2 columns, so ". 5+1.5=2" is correct.
% Total 3 columns with a total column width of 10.5cm. The 1th column has a width of 3cm and the column width of column 3rd is 3 times times that of the column width of the 2nd column, which is automatically calculated. The 2nd column is centered around the text. Note: The \multicolum command cannot span the x column.
\hline
The wise fish often row the temple before biting the hook & this is because they want to break food safety & know they think it's dangerous \
\hline
They will not eat & if they decide there is no danger & they remarked swallow hooks \ \
\hline
A glimpse of the danger of bait, but also involuntarily to swallow the hook & that is just people's psychology and not the psychology of Fish & is a man's folly and not the fish of the Ken \
\hline
\end{tabularx}

\end{cjk*}
\end{document}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.