Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

latexteada
latexteada

Posted on

LaTeX Tables: The Tabular Environment

Hello, in this post I talk about tables and the tabular environment.

Why is that environment (the tabular environment) so important? well, this is a float environment, which means it is an easy-to-manipulate environment. We can modify the position, alignment, create captions, labels, etc.
The syntax of that command is

\begin{tabular}Your Table Here\end{tabular}
Enter fullscreen modeExit fullscreen mode

We must put thetabular environment inside thetable environment. This command has some optional commands, the full command to create a table is the following

\begin{table}[position]   align    \begin{tabular}{columns}      My Table    \end{tabular}\end{table}
Enter fullscreen modeExit fullscreen mode

position options

We can specify the position of the table with the following options

  • h to put the tablehere, it is, at the current position of your cursor in the code
  • b to put the table at thebottom of the current page
  • t to put the table at thetop of the current page

If we want to put the table in the current position and we can put!, this ignores the restrictions and the table is attempted to put in the specified position

align options

We can align our table with the following commands

  • \centering
  • \flushleft
  • \flushright

columns options

Here we specify the number of columns and their position

  • l text to the left
  • c centered text
  • r text to the right
  • | put a vertical line between columns

Until now we have checked how to align and create new columns, let's start our table

  • \hline generates a horizontal line
  • & jumps to the next column (we have declared the number of columns in thecolumns option. If we put more columns there will be an error)
  • \\ jumps to the next row

Examples

You can find some exampleshere

I encourage you to play with these commands and create your table.

This is all for today, thanks :)

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Hello, this is where I am going to give some base briefs of LaTeX
  • Location
    México
  • Work
    Student
  • Joined

More fromlatexteada

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp