2

I type following program.

\usepackage{pifont}
\usepackage{tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\newcommand{\cmark}{{\Large\bfseries\color{green!50!black}\ding{51}}}
\newcommand{\xmark}{{\Large\bfseries\color{red!50!black}\ding{55}}}
 \begin{tabularx}{\textwidth}{cCCCC}
                                     & {\scriptsize EAP-MD5} & {\scriptsize PEAP} & {\scriptsize EAP-TTLS} & {\scriptsize EAP-TLS} \\
            \hline
            ServerEC\footnotemark[1] & \xmark                & \cmark             & \cmark                 & \cmark                \\
            \hline
            ClientEC\footnotemark[1] & \xmark                & \xmark             & \xmark                 & \xmark                \\
            ClientAuth               & ID / PW               & ID / PW            & ID / PW                & EC                    \\
            ServerAuth               & NONE                  & EC                 & EC                     & EC                    \\
            \hline
        \end{tabularx}

But The PDF outputted is here. enter image description here

Please help ME! Thank you.

1 Answer 1

2

Like this?

enter image description here

You should change definitions for \cmark and \xmark. Instead of use color{...} you should use \textcolor{<desired color}{<symvol>}. See MWE below:

\documentclass[a4paper,12pt]{article}
\usepackage{pifont}
\usepackage[table]{xcolor}
\usepackage{tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\newcommand{\cmark}{{\Large\bfseries\textcolor{green!50!black}{\ding{51}}}} % <---
\newcommand{\xmark}{{\Large\bfseries\textcolor{red!50!black}{\ding{55}}}}   % <---

\begin{document}
\setlength\extrarowheight{4pt}  % <---
 \begin{tabularx}{\textwidth}{lCCCC}
                                     & {\scriptsize EAP-MD5} & {\scriptsize PEAP} & {\scriptsize EAP-TTLS} & {\scriptsize EAP-TLS} \\
            \hline
            ServerEC\footnotemark[1] & \xmark                & \cmark             & \cmark                 & \cmark                \\
            \hline
            ClientEC\footnotemark[1] & \xmark                & \xmark             & \xmark                 & \xmark                \\
            ClientAuth               & ID / PW               & ID / PW            & ID / PW                & EC                    \\
            ServerAuth               & NONE                  & EC                 & EC                     & EC                    \\
            \hline
        \end{tabularx}
\end{document}

Addendum:
A we bit simpler code you can get by use of the talltblt of tabularray package. Using it and booktabs rules (which can be used at tabularx table too) obtained table is to my opinion nicer and more correct:

\documentclass[a4paper,12pt]{article}
\usepackage{pifont}
\usepackage{xcolor}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}
\newcommand{\cmark}{{\Large\bfseries\textcolor{green!50!black}{\ding{51}}}} % <---
\newcommand{\xmark}{{\Large\bfseries\textcolor{red!50!black}{\ding{55}}}}   % <---

\begin{document}

\begin{talltblr}[
caption = {table caption},
  label = {tab:?},
note{a} = {explanation ...},
note{b} = {explanation ...},
                ]{colspec = {l *{3}{X[c]}},
                  row{1} = {font=\footnotesize}
                  }
                        &   EAP-MD5 &   PEAP    &   EAP-TTLS    &   EAP-TLS     \\
    \midrule
ServerEC\TblrNote{a}    & \xmark    & \cmark    & \cmark        & \cmark        \\
    \midrule
ClientEC\TblrNote{b}    & \xmark    & \xmark    & \xmark        & \xmark        \\
ClientAuth              & ID / PW   & ID / PW   & ID / PW       & EC            \\
ServerAuth              & NONE      & EC        & EC            & EC            \\
    \bottomrule
\end{talltblr}
\end{document}

enter image description here

2
  • Thank you very much! I can solve using textcolor. Commented Sep 28, 2023 at 6:10
  • @KokiMIZOGUCHI, you are welcome! BTW, see addendum to answer. It may better fit to your needs :-).
    – Zarko
    Commented Sep 28, 2023 at 6:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .