-1

I want to create a table like the below

enter image description here

I have tried like this

\begin{tabular}{|c|c|c|c|c|}
        \hline\text{Parabola}&\text{Curve}&\text{Focus}&\text{Dirextrix}&\text{Vertex}\\\hline $x^2=4py$&\text{up, if}\thinspace $p>0$\newline\text{down, if}\thinspace $p<0$&&&\\\hline$y^2=4px$&&&&\\\hline&&&&\\\hline
    \end{tabular}

But there is problem in all each column which I am facing except the first column. Color is not necessary.

moewe
  • 175,683

2 Answers2

3

This should be replica of your image in question:

enter image description here

\documentclass{article}%
\usepackage[table]{xcolor}          % coloring first row in table
\usepackage{array, multirow}        % for multirow cells in the first columns
\usepackage[column=O]{cellspace}    % for additional vertical space around cells' contents
    \setlength\cellspacetoplimit{3pt}
    \setlength\cellspacebottomlimit{3pt}

\begin{document}

\begin{tabular}{| c | r @{\ } >{$}Ol<{$} | >{$}c<{$} | >{$}c<{$} | >{$}c<{$} |} {$}c<{$}|>{$}c<{$}|} \hline \rowcolor{blue!20} \textbf{Parabola}
&\multicolumn{2}{c|}{\textbf{Curve}}&\textbf{Focus}
& \textbf{Dirextrix} & \textbf{Vertex} \ \hline \multirow{2}{}{$x^2=4py$} & up, if & p>0 & F(0,p) & y=-p & V(0,0,) \ & down, if & p<0 & F(0,p) & y=-p & V(0,0,) \ \hline \multirow{2}{}{$y^2=4px$} & right, if & p>0 & F(0,p) & y=-p & V(0,0,) \ & left, if & p<0 & F(0,p) & y=-p & V(0,0,) \ \hline \end{tabular}

\end{document}

Zarko
  • 296,517
1
\documentclass[draft]{article}
\usepackage[table]{xcolor}
\begin{document}\begin{tabular}{|c|r@{\ }l|c|c|c|}\hline
\rowcolor{blue!20}\textbf{Parabola}&\multicolumn{2}{c|}{\textbf{Curve}}&\textbf{Focus}&\textbf{Dirextrix}&\textbf{Vertex}\\\hline 
$x^2=4py$&up, if &$p>0$&$F(0,p)$&$y=-p$&$V(0,0)$\\
& down, if&$p<0$&$F(0,p)$&$y=-p$&$V(0,0)$\\\hline
$y^2=4px$&right, if&$p>0$&$F(0,p)$&$y=-p$&$V(0,0)$\\
& left, if&$p<0$&$F(0,p)$&$y=-p$&$V(0,0)$\\\hline
\end{tabular}
\end{document}

table

Oni
  • 705