4

My sense is that I am missing something basic, but here goes:

I have a \tabular object, and on the same line as it ends, I wish to put a \Box

If I create a dummy column to store the \Box then the table is not wide enough (I want the box at the end of the line)

If I use \hfill $\Box$ after the end of the table (if there is a manual newline after the table, else it vertically centers it on the right which is also not what I want) it left justifies as it is the only thing on the line. If I use test \hfill $\Box$ I get what I want (well, its really one line down too far, but thats OK) but with a pesky test at the beginning of the line (as an aside, this seems to be a common issue with me, so if there is a way to have a "dummy" (not visible, has no other impact on the document) character that would do as well).

How can I get what I am looking for?

3
  • The "dummy" object that you are looking for can be \mbox{} or \null. Commented Sep 6, 2012 at 3:51
  • @GonzaloMedina this works and I will accept it, but I would prefer a cleaner way (and on the same line as the end of the table)
    – soandos
    Commented Sep 6, 2012 at 3:58
  • I was not proposing using \mbox{} or \null as part of the solution; I was only mentioning that this is the standard "dummy" object you were asking for. Commented Sep 6, 2012 at 4:05

1 Answer 1

4

Use the [b] optional argument for tabular:

\documentclass{article}
\usepackage{amssymb}

\begin{document}

\begin{tabular}[b]{|cc|}
text & text \\
text & text \\
text & text \\
\end{tabular}\hfill$\Box$

\end{document}

enter image description here

Using [t], the top line of the table is aligned with the baseline of the current external line of text; using [b], the bottom line of the table is aligned with the external baseline; with [c] (or with no positioning argument given), the table is centered on the external baseline.

4
  • For some reason it come it comes out vertically centered on my table (snag.gy/8VBNP.jpg for an example of what it looks like on my table)
    – soandos
    Commented Sep 6, 2012 at 3:53
  • @soandos Did you use the [b] alignment specifier I used in my example for tabular? Commented Sep 6, 2012 at 3:54
  • Worked perfectly, thanks. What does it do?
    – soandos
    Commented Sep 6, 2012 at 3:59
  • @soandos [b] vertically aligns the table at the bottom, [t] aligns it at the top and [c] (default) at the center. Commented Sep 6, 2012 at 4:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .