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/06/03 13:17] – d.p.carlisle | 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? ====== |
| - | title: Variable-width columns in tables | + | |
| - | category: floats | + | |
| - | tags: | + | |
| - | - tables | + | |
| - | - figures | + | |
| - | permalink: / | + | |
| - | --- | + | |
| - | This is a slightly different take on the problem addressed in | ||
| - | " | ||
| - | a column whose size we can't absolutely predict when we design the | ||
| - | document. | ||
| - | While the basic techniques (the [`tabularx`](https:// | + | Il s'agit d'une version légèrement différente du problème abordé dans |
| - | and [`ltxtable`](https:// | + | « [[3_composition/tableaux/fixer_la_largeur_d_un_tableau|Comment fixer la largeur d'un tableau?]] ». |
| - | fixed-width _table_ problem, there's one extra tool that we can | + | Ici, nous avons une colonne dont nous ne pouvons pas prévoir la taille |
| - | call to our aid, which may be preferable in some situations. | + | au moment de l'écriture du document. |
| - | Suppose we have data in one column which we read from an external | + | Si les techniques de base sont les mêmes pour ce problème que pour celui des tableaux à largeur déterminée, |
| - | source, and the source itself isn't entirely predictable. | + | avec les extensions [[ctanpkg> |
| - | the column may end up pretty narrow in every row of the table, or it | + | il existe un outil supplémentaire que nous pouvons appeler à notre secours et est préférable |
| - | may be wide enough that the table would run over the edge of the page; | + | dans certaines situations. |
| - | however, we don't want to make the column as wide as possible " | + | |
| - | in case", by defining a fixed size for the table. | + | |
| - | column to be as small as possible, but have the possibility to spread | + | |
| - | to a maximum width and (if even that width is exceeded) turn into a | + | |
| - | `p`-style column. | + | |
| - | The [`varwidth`](https:// | + | Supposons que le contenu d'une colonne soit lu à partir d'une source externe, |
| - | "[automatic sizing of minipages](FAQ-varwidth)" | + | et que la source elle-même ne soit pas entièrement prévisible. Ce contenu |
| - | a solution. | + | est parfois étroit, mais d' |
| - | [`array`](https:// | + | cependant, nous ne voulons pas rendre la colonne aussi large que possible « juste au cas où », |
| - | ```latex | + | en donnant une taille fixe au tableau. Nous aimerions que la colonne soit aussi petite que possible, |
| - | \usepackage{array} | + | mais qu' |
| - | \usepackage{varwidth} | + | en question est dépassée, de se transformer en une colonne de style '' |
| - | ``` | + | se répartisse sur plusieurs lignes. |
| - | [`varwidth`](https:// | + | |
| - | can use as follows: | + | L' |
| - | ```latex | + | « [[3_composition: |
| + | offre une solution. | ||
| + | elle définira un nouveau type de colonne, '' | ||
| + | |||
| + | <WRAP column 50ex> | ||
| + | < | ||
| + | \documentclass{article} | ||
| + | | ||
| + | \usepackage{varwidth} | ||
| + | |||
| + | \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: | ||
| + | }} | ||

