\noindent
\begin{tabularx}{\textwidth}{| X | X | X |}
\hline
LocationProvider & Description & blalala \\
\hline
network & Uses the mobile network or WI-Fi to determine the best
location.Might have a higher precision in closed rooms than GPS
Uses the mobile network or WI-Fi to determine the best
location.Might have a higher precision in closed rooms than GPSUses the mobile network or WI-Fi to determine the best
location.Might have a higher precision in closed rooms than GPSUses the mobile network or WI-Fi to determine the best
location.Might have a higher precision in closed rooms than GPS. \\
\hline
gps & Use the GPS receiver in the Android device to determine the best
location via satellites. Usually better precision than network. \\
\hline
passive & Allows to participate in location of updates of other components
to save energy \\
\hline
\end{tabularx}
答案1
\documentclass[10pt,a4paper]{article}
\usepackage{tabularx}
\begin{document}
\begin{tabularx}{\textwidth}{| X | X | X |}
\hline
LocationProvider & Description & blalala \\
\hline
network
& Uses the mobile network or WI-Fi to determine the best
location.Might have a higher precision in closed rooms than GPS
Uses the mobile network or WI-Fi to determine the best
location.Might have a higher precision in closed rooms than GPSUses the mobile network or WI-Fi to determine the best
location.Might have a higher precision in closed rooms than GPSUses the mobile network or WI-Fi to determine the best
location.Might have a higher precision in closed rooms than GPS.
& \\
\hline
gps
& Use the GPS receiver in the Android device to determine the best
location via satellites. Usually better precision than network.
&\\
\hline
passive
& Allows to participate in location of updates of other components
to save energy
&\\
\hline
\end{tabularx}
\end{document}
标题
\documentclass[10pt,a4paper]{article}
%\usepackage[utf8]{inputenc}
%\usepackage[T1]{fontenc}
\usepackage{tabularx, booktabs}
\begin{document}
\begin{table}
\caption{Something to describe the table}
\begin{tabularx}{\textwidth}{ X X X }
\multicolumn{3}{c}{1. Something to describe the table}\\
\toprule
LocationProvider & Description & blalala \\
\midrule
network
& Uses the mobile network or WI-Fi to determine the best
location.Might have a higher precision in closed rooms than GPS
Uses the mobile network or WI-Fi to determine the best
location.Might have a higher precision in closed rooms than GPSUses the mobile network or WI-Fi to determine the best
location.Might have a higher precision in closed rooms than GPSUses the mobile network or WI-Fi to determine the best
location.Might have a higher precision in closed rooms than GPS.
& \\
\midrule
gps
& Use the GPS receiver in the Android device to determine the best
location via satellites. Usually better precision than network.
&\\
\midrule
passive
& Allows to participate in location of updates of other components
to save energy
&\\
\bottomrule
\end{tabularx}
\end{table}
\end{document}
由于中心柱太长
使用p
固定宽度的类型列
\documentclass[10pt,a4paper]{article}
%\usepackage[utf8]{inputenc}
%\usepackage[T1]{fontenc}
\usepackage{tabularx, booktabs, makecell}
\renewcommand\theadfont{}
\begin{document}
\begin{tabularx}{\textwidth}{ p{3cm} X p{1.5cm} }
\multicolumn{3}{c}{1. Something to describe the table}\\
\toprule
\thead{LocationProvider} & \thead{Description} & \thead{blalala} \\
\midrule
network
& Uses the mobile network or WI-Fi to determine the best
location.Might have a higher precision in closed rooms than GPS
Uses the mobile network or WI-Fi to determine the best
location.Might have a higher precision in closed rooms than GPSUses the mobile network or WI-Fi to determine the best
location.Might have a higher precision in closed rooms than GPSUses the mobile network or WI-Fi to determine the best
location.Might have a higher precision in closed rooms than GPS.
& \\
\midrule
gps
& Use the GPS receiver in the Android device to determine the best
location via satellites. Usually better precision than network.
&\\
\midrule
passive
& Allows to participate in location of updates of other components
to save energy
&\\
\bottomrule
\end{tabularx}
\end{document}
答案2
您的问题不太清楚。您应该提供更多信息,例如:
- 使用文档类别。
- 页面布局(一列或两列文档,大小
\textwidth
,...) - 更真实地模仿真实表格(第三列单元格内容的大小未知)
- 您的问题标题是什么意思:“如何关闭此文档的最后一列?”我认为最后一列没有任何问题。
由于缺乏上述信息,我们只能猜测您真正的问题是什么,因此我们提出的所有建议可能都是题外话。下面建议的解决方案假设该表位于具有默认设置的文章中,其中使用了包。
booktabs
用于表格中的水平线makecell
用于编写列标题microtype
使单元格中的文本间距更好ragged2e
用于对单元格中的文本进行“智能”连字。
提出的解决方案是根据我的喜好来设计这样的表格的(意味着非常基于意见):
\documentclass{article}
\usepackage{microtype}
\usepackage{ragged2e}
\usepackage{booktabs, makecell, tabularx}
\renewcommand\theadgape{}
\newcolumntype{L}[1]{>{\RaggedRight\hspace{0pt}\hsize=#1\hsize}X}
\usepackage[skip=1ex]{caption}
\begin{document}
\begin{table}[ht]
\caption{Table caption}
\label{tab:...}
\small
\begin{tabularx}{\textwidth}{@{} l L{1.5} L{0.5} @{}}
\toprule
\thead{Location\\Provider} & \thead{Description} & \thead{blalala} \\
\midrule
network & Uses the mobile network or W-Fi to determine the best
location.Might have a higher precision in closed rooms than GPS
Uses the mobile network or Wi-Fi to determine the best location. Might have a higher precision in closed rooms than GPS Uses the mobile network or Wi-Fi to determine the best. Might have a higher precision in closed rooms than GPS Uses the mobile network or WI-Fi to determine the best location. Might have a higher precision in closed rooms than GPS.
& Unknown size and type of the content \dots\\
\addlinespace
GPS & Use the GPS receiver in the Android device to determine the best
location via satellites. Usually better precision than network.
& \\
\addlinespace
passive & Allows to participate in location of updates of other components
to save energy
& \\
\bottomrule
\end{tabularx}
\end{table}
\end{document}