2

How can i make the text in the first row in the center of cell, and how i can make number "1" in the center of cell as it is indicated with a red rectangle.

\documentclass[12pt,a4paper]{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{cfr-lm}         % instead of the "[cyr]{aeguill}"

\usepackage[table]{xcolor}
\usepackage{ragged2e}       % new
\usepackage{booktabs,       % new
            makecell,       % new
            tabularx}       % new
\renewcommand\theadfont{\small\bfseries}
\renewcommand\theadgape{}
\newcolumntype{L}{>{\RaggedRight}X} % redefined    

%---------------------------------------------------------------%

\begin{document}
    \begin{table}[htb]
    \footnotesize
    \setlength\tabcolsep{4pt}
\begin{tabularx}{\linewidth}{@{}|
    >{\large}c|
    >{\hsize=0.25\hsize}L|
    >{\hsize=0.25\hsize}L|
    >{\hsize=0.50\hsize}L|   @{}}
    \hline
\thead[l]{RG}
    &   \thead[l]{Définition}
        &   \thead[l]{Mapping}
            &   \thead[l]{Règles de gestion spécifiques}                                               \\
    \hline
1   & Portail Date Traitement Courant
        & RBP vTBADMRB \_SUIVI\_APPLI.D \_TRAIT
            &   CASE WHEN

                [RBP Presentation View].[Dimension Référentiel Datamart].[L\_DATMR]

                = `PORTAIL' THEN [RBP  Presentation View].[Fait Suivi Application].[D\_TRAIT] END  \\

    \hline
\end{tabularx}
\caption{Équipe de travail}
\end{table}
\end{document}

enter image description here

Bernard
  • 271,350
  • 1
    it is time to read packages documentations, isn't it? instead \thead[l]{...} you should write \thead{...}. number one is in the place where you require in one of your previous question. put it in \multirow cell. – Zarko May 27 '18 at 17:33

1 Answers1

1

Fot the column head, remove the [t] option of thead to have the defalt alignment (centred both vertically and horizontally). For the position of 1, you can use \multirowcell  wwith a small adjustment. Since you load makecell, I use it to add some vertical padding at the top and bottom of cells, with\setcellgapes`:

\documentclass[12pt, a4paper]{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{cfr-lm} % instead of the "[cyr]{aeguill}"

\usepackage[table]{xcolor}
\usepackage{ragged2e} % new
\usepackage{booktabs, % new
            multirow,
            makecell, % new
            tabularx} % new
\renewcommand\theadfont{\small\bfseries}
\renewcommand\theadgape{}
\newcolumntype{L}{>{\RaggedRight}X} % redefined

%---------------------------------------------------------------%

\begin{document}
    \begin{table}[htb]
    \footnotesize
    \setlength\tabcolsep{4pt}
    \setcellgapes{3pt}\makegapedcells
\begin{tabularx}{\linewidth}{@{}|
    >{\large}c|
    >{\hsize=0.25\hsize}L|
    >{\hsize=0.25\hsize}L|
    >{\hsize=0.50\hsize}L| @{}}
    \hline
\thead{RG}
    & \thead{Définition}
        & \thead{Mapping}
            & \thead{Règles de gestion spécifiques} \\
    \hline
\multirowcell{1}[-4ex] {1}& Portail Date Traitement Courant
        & RBP vTBADMRB \_SUIVI\_APPLI.D \_TRAIT
            & CASE WHEN

                [RBP Presentation View].[Dimension Référentiel Datamart].[L\_DATMR]

                = `PORTAIL' THEN [RBP Presentation View].[Fait Suivi Application].[D\_TRAIT] END \\

    \hline
\end{tabularx}
\caption{Équipe de travail}
\end{table}
\end{document} 

enter image description here

Bernard
  • 271,350
  • as i said in my comment ... op has \thead[l]{...} not \thead[t]{...} . and congratulation, your answer to him is the first one which he accepted :-). – Zarko May 27 '18 at 18:02
  • Thanks, @Zarko. B.t.w., I'm surprised the code for the relative widths of the X columns seems to work nicely: the documentation says the sum of the coefficients should be equal to the number of X columns – in other words they should be 0.75 and 1.5 instead of 0.25 and 0.5. I wonder whether the way of coding X columns changed recently in this respect? – Bernard May 27 '18 at 18:28
  • as far as i know, the package tabu is not maintained for years, so nothing is changed. code, which op use, is from my answer https://tex.stackexchange.com/questions/433428/position-text-at-the-top-of-cell-in-table-if-there-is-a-large-text-in-the-second/433433#433433, where i consider that sum is equal 1 (0.25, 0.25 and 0.5). however, the same result is obtained with 1, 1 and 2, which sum is integer 4. or as you say 0.75, 0,75 and 1,5. in all cases the ration between X columns width is the same. as i remember tabu in this follows to tabularx – Zarko May 27 '18 at 18:39