Creating a Table with Latex - No Packages Needed

  • LaTeX
  • Thread starter Rajini
  • Start date
  • Tags
    Latex Table
In summary, the conversation is about creating a table using LaTeX and having trouble with it automatically going to the next page when there are a lot of abbreviations. The person also mentions not wanting to use specific packages and only wanting to include a few footnotes. They later mention that they were able to solve the issue by creating a second table at the end of the first page.
  • #1
Rajini
621
4
Hello all,
i need a help in making table using latex.

My code:
\begin{tabular}{ll}
$v$ & Velocity
$p$ & Momentum
.
.
\end{tabular}
I use it for my List of abbreviations section...But when i use lots of abbreviations..it is not automatically going to next page.??
I don't want to use some packages specifically for 'abbreviations or symbols'..[also don't want any caption and label but one or two footnotes i may use]
can somebody over here help me..
thanks
 
Last edited:
Physics news on Phys.org
  • #2
oh i solved,
I just made one more table exactly placed at the end of first page.
After compiling i can see where it ends..and then start a new table..
 

1. How do I create a table in Latex without using any packages?

To create a table in Latex without using any packages, you can use the basic tabular environment. First, start by defining the number of columns and their alignment using the l, c, and r commands. Then use the & symbol to separate the columns and the \\ command to start a new row. Finally, use the \hline command to insert horizontal lines between rows. Here's an example:

\begin{tabular}{|l|c|r|}
\hline
Column 1 & Column 2 & Column 3 \\
\hline
Row 1 & Row 1 & Row 1 \\
Row 2 & Row 2 & Row 2 \\
\hline
\end{tabular}

2. Can I add formatting to my table without using any packages?

Yes, you can add formatting to your table by using the \multicolumn and \multirow commands. These commands allow you to merge cells in a row or column, respectively. You can also use the \cline command to insert partial horizontal lines. Here's an example:

\begin{tabular}{|l|c|r|}
\hline
\multicolumn{2}{|c|}{Column 1 and 2} & Column 3 \\
\cline{1-2}
Row 1 & Row 1 & Row 1 \\
Row 2 & Row 2 & Row 2 \\
\hline
\end{tabular}

3. How do I add captions and labels to my table?

To add a caption to your table, use the \caption command before the tabular environment. You can also use the \label command to create a reference for your table. Here's an example:

\begin{table}[h]
\centering
\caption{Example Table}
\label{tab:example}
\begin{tabular}{|l|c|r|}
\hline
Column 1 & Column 2 & Column 3 \\
\hline
Row 1 & Row 1 & Row 1 \\
Row 2 & Row 2 & Row 2 \\
\hline
\end{tabular}
\end{table}

4. Is it possible to merge cells both horizontally and vertically?

Yes, you can merge cells both horizontally and vertically by combining the \multicolumn and \multirow commands. To merge cells horizontally, use the \multicolumn command with the number of columns to be merged as the first argument. To merge cells vertically, use the \multirow command with the number of rows to be merged as the second argument. Here's an example:

\begin{tabular}{|l|c|r|}
\hline
\multirow{2}{*}{Column 1 and 2} & Column 2 & Column 3 \\
\cline{2-3}
& Row 1 & Row 1 \\
& Row 2 & Row 2 \\
\hline
\end{tabular}

5. Can I add color to my table without using any packages?

Yes, you can add color to your table by using the \cellcolor command. This command allows you to change the background color of a specific cell. You can also use the \rowcolor command to change the background color of an entire row. Here's an example:

\begin{tabular}{|l|c|r|}
\hline
\rowcolor{gray} Column 1 & Column 2 & Column 3 \\
\hline
\cellcolor{blue} Row 1 & Row 1 & Row 1 \\
\cellcolor{green} Row 2 & Row 2 & Row 2 \\
\hline
\end{tabular}

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
380
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
23
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
11K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
961
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
Back
Top