1

I have a table I am using for some headings. I would like the first entry in the table to not be indented, while being able to maintain the space between the first and seconds table items.

enter image description here

The latex code for my document:

\documentclass[letterpaper,11pt]{article}
\usepackage[empty]{fullpage}
\setlength{\parskip}{\baselineskip}%
\setlength{\parindent}{0pt}%
\usepackage[
top    = 0.608cm,
bottom = 0.664cm,
left   = 1.20cm,
right  = 1.10cm]{geometry}
\begin{document}

\begin{tabular}{p{15cm} p{4cm}}
    \textbf{Company name} - position & 01/0001 - 12/2999
\end{tabular}\\
Just some random filler text

\end{document}

I found this answer, which works but I have not been able to make it work while maintaining the spacing as I have it currently.

Is there a way?

  • I'm not seeing the need for a table. It seems like \noindent\textbf{Company name} - position\hfill01/0001 - 12/2999\\ would do the job, and be more semantic as well (and use \makebox or \parbox if you truly need the widths). – Teepeemm Dec 17 '19 at 20:51
  • Try \setlength{\tabcolsep}{0pt}% preferably in a group or environment. – John Kormylo Dec 17 '19 at 21:33
  • @Teepeemm Is there something negative about using a table? – Jake Rankin Dec 19 '19 at 19:44
  • It's similar to the idea that using <table> tags is bad in html if you're only doing it for layout purposes. A table should be for data in a tabular format, otherwise you're mixing styling and content. (There's also a house of cards phenomena - the more commands you add in to try to make something work, the more likely something will go wrong.) – Teepeemm Dec 19 '19 at 22:10

1 Answers1

2

Just add @{} in before the first p column to remove the side bearing in the tabular. All columns has a \tabcolsep white space at each side. @{} remove the space between columns. You can do the same in the last column, to move right aligned (or justified) text in a column to the right margin.

The package fullpage is unnecessary when you use geometry, and in addition, geometry is a modern, flexible and much better package.

enter image description here

\documentclass[letterpaper,11pt]{article}
%\usepackage[empty]{fullpage}   %% Remove this line
\setlength{\parskip}{\baselineskip}%
\setlength{\parindent}{0pt}%
\usepackage[
top    = 0.608cm,
bottom = 0.664cm,
left   = 1.20cm,
right  = 1.10cm]{geometry}
\begin{document}

\begin{tabular}{@{}p{15cm} p{4cm}}
    \textbf{Company name} - position & 01/0001 - 12/2999
\end{tabular}\\
Just some random filler text

\end{document}
Bernard
  • 271,350
Sveinung
  • 20,355