Hello,
I have generated a table of about 8 columns that have middle centering each and in 4 of the columns I would like to have the column of data to be centered about the plus and minus sign. My thoughts were to create a save box that was centered about the \pm and insert this inside the table. Unfortunately, the original tables centering is overriding my desire to change this based on what I place in the column. Below is an example of the first two rows of a 26 row table.
the savebox will go into the last 4 columns which I want to be centered about the \pm
newsavebox\myboxa
\savebox\myboxa{%
$\begin{array}{rcl}
0.3& \pm &.02
\end{array}$}
\newsavebox\myboxaa
\savebox\myboxaa{%
$\begin{array}{rcl}
3824.2 &\pm &772.6
\end{array}$}
\newsavebox\myboxaaa
\savebox\myboxaaa{%
$\begin{array}{rcl}
88.5& \pm &2.4
\end{array}$}
\newsavebox\myboxaaaa
\savebox\myboxaaaa{%
$\begin{array}{rcl}
79.6& \pm &2.9
\end{array}$}
\newsavebox\myboxb
\savebox\myboxb{%
$\begin{array}{rcl}
0.25&\pm&.02
\end{array}$}
\newsavebox\myboxbb
\savebox\myboxbb{%
$\begin{array}{rcl}
4375.5&\pm&89
\end{array}$}
\newsavebox\myboxbbb
\savebox\myboxbbb{%
$\begin{array}{rcl}
76.7&\pm&2.2
\end{array}$}
\newsavebox\myboxbbbb
\savebox\myboxbbbb{%
$\begin{array}{rcl}
67.9&\pm&2.8
\end{array}$}
\begin{table*}[!h]
\caption{\label{tab:table4}A Summary of detailed syllable analysis}
\begin{ruledtabular}
\begin{tabular}{lllccccc}
$Syllable$ &$Frequency Sweep$ &$Repeated$ &$Duration$ &$Spacing$ &$Dominent Frequency/PF$ &$Peak Power$ &$Energy$\\
\hline
A& Linear & Single & \usebox\myboxa& $ - $ & \usebox\myboxaa & \usebox\myboxaaa &\usebox\myboxaaaa \\
B& Linear & Single & \usebox\myboxb& $ - $ & \usebox\myboxbb & \usebox\myboxbbb & \usebox\myboxbbbb\\
\end{tabular}
\end{ruledtabular}
\end{table*}
Thanks for any help.
angleg
Graphics, Figures & Tables ⇒ Centering a columns in a table about \pm
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Centering a columns in a table about \pm
At first, please
Best regards
Thorsten
- Always provide a small, complete and compilable, shortly said a minimal working example (MWE).
- Use the code environment for tagging longer pieces of code to keep this code and the post clear.
Best regards
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10