Graphics, Figures & Tables ⇒ Table: force exact same column width
-
- Posts: 2
- Joined: Thu Apr 17, 2014 6:46 pm
Table: force exact same column width
I'm trieng to make a balans sheet (through table environment) and would like to have two columns with the exact same width. Anyone idea's?
This is my current Latex code and output:
\begin{table}[h!]
\centering
\begin{tabular}{lr|lr}
\multicolumn{4}{c}{Balans te 31/12/20XX} \\
\hline\hline
Revendication & 1 000 & Equity & 1 000 \\
Shares & 500 & Profit & 500 \\
& & & \\
& & Short term liability & 500 \\
\hline
\end{tabular}
\caption{Scenario A: inbreng tegen nominale waarde}
\label{table:ScA_Nom}
\end{table}
- Attachments
-
- Result Latex output
- Naamloos.png (18.2 KiB) Viewed 16409 times
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Table: force exact same column width
I also loaded package siunitx to take care of your number columns. Decimal points will now be aligned.
Code: Select all
\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{siunitx}
\begin{document}
\begin{table}%[h!]%JB: don't do that. It's really bad.
\centering
\begin{tabular}{p{3cm}S|p{3cm}S}
\multicolumn{4}{c}{Balans te 31/12/20XX} \\
\hline\hline
Revendication & 1 000 & Equity & 1 000 \\
Shares & 500 & Profit & 500 \\
& & & \\
& & Short term liability & 500 \\
Something & 5,12 & else &1000000,20 \\
\hline
\end{tabular}
\caption{Scenario A: inbreng tegen nominale waarde}
\label{table:ScA_Nom}
\end{table}
\end{document}
-
- Posts: 2
- Joined: Thu Apr 17, 2014 6:46 pm