Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| composition:tableaux:colonnes:faire_varier_la_largeur_de_colonnes [2018/05/25 08:57] – joseph.wright | 3_composition:tableaux:colonnes:faire_varier_la_largeur_de_colonnes [2021/05/24 19:24] (Version actuelle) – Traduction en français. Compilation des exemples. jejust | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | --- | + | ====== Comment avoir des colonnes de largeur variable dans un tableau? ====== | 
| - | section: How do I do& | + | |
| - | subsection: Tables, figures and diagrams | + | |
| - | permalink: / | + | |
| - | date: 2014-06-10 | + | |
| - | --- | + | |
| - | # Variable-width columns in tables | ||
| - | This is a slightly different take on the problem addressed in | + | Il s'agit d'une version légèrement différente du problème abordé dans | 
| - | '' | + | « [[3_composition/ | 
| - | a column whose size we can't absolutely predict when we design the | + | Ici, nous avons une colonne dont nous ne pouvons pas prévoir la taille | 
| - | document. | + | au moment de l' | 
| - | While the basic techniques  | + | Si les techniques  | 
| - | and [`ltxtable`](https:// | + | avec les extensions [[ctanpkg>tabularx]], [[ctanpkg> | 
| - | fixed-width _table_ problem, there' | + | il existe un outil supplémentaire que nous pouvons appeler à notre secours et est préférable | 
| - | call to our aid, which may be preferable in some situations. | + | dans certaines  | 
| - | Suppose we have data in one column which we read from an external | + | Supposons que le contenu d'une colonne soit lu à partir d' | 
| - | source,  | + | et que la source  | 
| - | the column may end up pretty narrow in every row of the table, or it | + | est parfois étroit, mais d' | 
| - | may be wide enough that the table would run over the edge of the page; | + | cependant, nous ne voulons pas rendre la colonne aussi large que possible  | 
| - | however, we don't want to make the column as wide as possible  | + | en donnant une taille fixe au tableau. Nous aimerions que la colonne soit aussi petite que possible, | 
| - | in case'' | + | mais qu' | 
| - | column to be as small as possible,  | + | en question est dépassée, de se transformer en une colonne de style '' | 
| - | to a maximum width and (if even that width is exceeded) turn into a | + | se répartisse sur plusieurs lignes. | 
| - | `p`-style column. | + | |
| - | The [`varwidth`](https:// | + | L' | 
| - | '' | + | « [[3_composition: | 
| - | a solution.  | + | offre une solution.  | 
| - | [`array`](https:// | + | elle définira un nouveau type de colonne, '' | 
| - | ```latex | + | |
| - | \usepackage{array} | + | <WRAP column 50ex> | 
| - | \usepackage{varwidth} | + | < | 
| - | ``` | + | \documentclass{article} | 
| - | [`varwidth`](https:// | + |    | 
| - | can use as follows: | + | \usepackage{varwidth} | 
| - | ```latex | + | |
| + | \begin{document} | ||
| \begin{tabular}{l V{3.5cm} r} | \begin{tabular}{l V{3.5cm} r} | ||
| foo & blah & bar \\ | foo & blah & bar \\ | ||
| foo & blah blah & bar \\ | foo & blah blah & bar \\ | ||
| \end{tabular} | \end{tabular} | ||
| - | ``` | + | \end{document} | 
| - | when the second  | + | </ | 
| - | or you can use it as follows: | + | </ | 
| - | ```latex | + | < | 
| + | < | ||
| + | \documentclass{article} | ||
| + | \usepackage{array} | ||
| + | \usepackage{varwidth} | ||
| + | \pagestyle{empty} | ||
| + | |||
| + | \begin{document} | ||
| + | \begin{tabular}{l V{3.5cm} r} | ||
| + | foo & blah & bar \\ | ||
| + | foo & blah blah & bar \\ | ||
| + | \end{tabular} | ||
| + | \end{document} | ||
| + | </ | ||
| + | </ | ||
| + | <WRAP clear/> | ||
| + | |||
| + | Dans l' | ||
| + | Voyons ce qui se passe quand son contenu s' | ||
| + | |||
| + | <WRAP column 50ex> | ||
| + | < | ||
| + | \documentclass{article} | ||
| + | \usepackage{array} | ||
| + | \usepackage{varwidth} | ||
| + | |||
| + | \begin{document} | ||
| \begin{tabular}{l V{3.5cm} r} | \begin{tabular}{l V{3.5cm} r} | ||
| foo & blah & bar \\ | foo & blah & bar \\ | ||
| Ligne 53: | Ligne 73: | ||
| & bar \\ | & bar \\ | ||
| \end{tabular} | \end{tabular} | ||
| - | ``` | + | \end{document} | 
| - | where the second  | + | </ | 
| - | a second line in the third row. | + | </ | 
| + | < | ||
| + | < | ||
| + | \documentclass{article} | ||
| + | \usepackage{array} | ||
| + | \usepackage{varwidth} | ||
| + | \pagestyle{empty} | ||
| + | |||
| + | \begin{document} | ||
| + | \begin{tabular}{l V{3.5cm} r} | ||
| + | foo & blah & bar \\ | ||
| + | foo & blah blah & bar \\ | ||
| + | foo & blah blah blah blah blah blah | ||
| + | & bar \\ | ||
| + | \end{tabular} | ||
| + | \end{document} | ||
| + | </ | ||
| + | </ | ||
| + | <WRAP clear/> | ||
| + | |||
| + | Ici, le contenu de la colonne centrale « s' | ||
| + | d' | ||
| + | |||
| + | |||
| + | ----- | ||
| + | //Source:// [[faquk> | ||
| + | {{htmlmetatags> | ||
| + | metatag-og: | ||
| + | metatag-og: | ||
| + | }} | ||

