Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have some tables that larger than my box text, but not my page. If I don't want to use the rotate package, what can I do to solve this problem? For example a picture of one of my pages is below enter image description here

(My language is Persian). Did you mean this code:

\begin{table}‎
\begin{center}‎
\begin{tabular}{|1 | {l}|{l}|{l}|{l}|{l}|{l}|}‎
\hline‎
‎‎‎طول‎‎‎‎‎‎ گام & ‎‎$‎‎‎50‎$‎‎ نقطه & مدت زمان & ‎$‎‎‎100‎$‎ نقطه & مدت زمان & ‎$‎‎‎500‎$‎ نقطه & مدت زمان‎\\‎
\hline
 ‎$‎h=.5‎‎$& $‎11.8860‎$  & $.736471 $ & $11.8904$ & $.888925$  & $11.898$ & $3.562203$ \\‎
 & ‎$‎5.7892‎$‎&‎&‎$‎5.7918‎$‎&&‎$‎5.79‎26‎‎$‎&\\‎‎
‎\hline‎
 ‎$h=.25$ & $11.8877$&$.908528‎$‎ & $11.8921$ & $1.347235$ & $11.8956$ & $6.909139$   \\‎‎
 & ‎$‎5.7917‎$‎&‎&‎$‎5.7943‎$‎&&‎$‎5.7951‎$‎&\\‎‎‎
\hline‎
$h=.125$ & $11.8898$ & $1.800350$ & $11.8944$ & $2.689663$ & $11.8971$ & $14.014022$ \\‎‎
  & ‎$‎5.7932‎$‎&‎&‎$‎5.7957‎$‎&&‎$‎5.7965‎$‎&\\‎‎‎
\hline‎
 ‎$h=.0625$ & $11.8913$ & $4.274611$ & $11.8957$ & $6.344984$ & $11.8971$ & $28.677729 $ \\‎‎
   & ‎$‎5.7940‎$‎&‎&‎$‎5.7965‎$‎&&‎$‎5.7974‎$‎&\\‎‎‎
\hline‎
 ‎$h=.03125$ & $11.8921$ & $11.680354$ & $11.8965$ & $15.990138$ & $11.8979$ & $60.642217$\\‎‎
    & ‎$‎5.7944‎$‎&‎&‎$‎5.7970‎$‎&&‎$‎5.7978‎$‎&\\‎‎‎‎
\hline‎
$h=.015625$ & $11.8926$ & $37.061820$ & $11.8970$ & $46.333275$ & $11.8984$ & $134.800034\\‎‎‎
 & ‎$‎5.7946‎$‎&‎&‎$‎5.7972‎$‎&&‎$‎5.7980‎$‎&\\‎‎‎‎‎
 ‎\hline‎
 ‎$h=.0078125$ & $11.8928$ & $131.220405$ & $11.8972$ & ‎$‎147.617634$ & $11.8986$ & $324.236971$ \\‎‎‎‎
& ‎$‎5.7948‎$‎&‎&‎$‎5.7973‎$‎&&‎$‎5.7982‎$‎&\\‎‎‎‎‎‎
\hline‎
 ‎$h=.00390625$ & $11.8929$ & $488.012921$ & $11.8973$ & ‎$‎519.168699$ & $11.8987$ & $893.012911$ \\‎‎‎‎‎
& ‎$‎5.7948‎$‎&‎&‎$‎5.7974‎$‎&&‎$‎5.7982‎$‎&\\‎‎‎‎‎‎‎
 ‎\hline
 ‎$h=.001953125$ & $11.8930$ & $1889.675150$ & $11.8974$ & ‎$‎1953.356823$ & $11.8988$ & $2723.479288$ \\‎‎‎‎‎‎
& ‎$‎5.7949‎$‎&‎&‎$‎5.7974‎$‎&&‎$‎5.7982‎$‎&\\‎‎‎‎‎‎
\hline‎      
\end{tabular}‎
\end{center}‎
\caption{‎‎نتایج مربوط به روش رانگه کوتا $2‎$‎ ‎\label{tab=4.11}}‎
\end{table}

share|improve this question
3  
Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Christian Hupfer Aug 25 at 7:42
3  
This question is very similar to tex.stackexchange.com/questions/10863/…. Please take a look at it as the information there might help you. If so, that's great, and we'll probably close this question as a duplicate just to keep the place tidy and to help people find answers quickly. If not, please edit your question here to explain why so that people can better focus their attention to help you. –  doncherry Aug 25 at 7:46
1  
If you use the {} botton you indent the code equal to four spaces andf it gets formattet nicely. Also, please read about the minimal working excample that Christian Hupfer linked to. –  Svend Tveskæg Aug 25 at 8:06
1  
I'd use the booktabs package and get rid of the vertical lines. That should get rid of some horizontal space. The last column has some repetition. Perhaps you can move write /h in the column header of the last row and get rid of the h=? –  Marc van Dongen Aug 25 at 9:45

3 Answers 3

up vote 5 down vote accepted

If the table is currently only slightly too wide and you do not want to resort to using \resizebox -- say, because you don't want to incur an uncontrolled change in font size -- you could try the following measures.

  • Reduce the value of the parameter \tabcolsep, which sets the amount of intercolumn whitespace. The default value of \tabcolsep is 6pt. Try if inserting the instruction \setlength\tabcolsep{2pt} immediately after \begin{table} produces an improvement.

  • If you're willing to get rid of the vertical lines, you'll save 0.4pt for every such line you get rid of. If you do drop the vertical lines, you could also get rid of the vertical whitespace to the left of the left-most column and to the right of the rightmost column, by specifying

    \begin{tabular}{@{}1 llllll @{}}‎ % "@{}" suppresses whitespace
    

    By the way, I would like to encourage you very strongly to get rid of the useless curly braces around each column type.

  • If the table still won't fit after you've implemented the preceding suggestions, it's time to start considering reducing the font size. Inserting the instruction \small after \begin{table} will induce a 10% (linear) reduction in the font size. If that's not enough, try \footnotesize, which induces a 20% linear reduction in font size.

  • Of course, you should also be willing to consider other measures. E.g., are all columns really needed, or could you get rid of one or more columns without the table's main information getting lost? And, for those columns you decide to retain, is it necessary to show all those digits, or could you (and your readers!) get by with fewer digits?

share|improve this answer

One idea, provided that the table is currently only slightly too wide, is to locally change your page's geometry using the geometry package and the command \newgeometry.

If for instance you have an a4paper set up using \usepackage[a4paper]{geometry} in your preamble you can locally make the page a bit wider(changing only the margins) using

\documentclass{article}
\usepackage[a4paper]{geometry}
\usepackage{lipsum}%a package for dummy text

    \begin{document}
     \lipsum[1]%just a dummy text
     \newgeometry{left=1cm,right=1cm}%change 1cm according to your needs
     \lipsum[1]%just a dummy text
     \restoregeometry
     \lipsum[1]%just a dummy text
    \end{document}

The result will be the following

Before enter image description here

After enter image description here

share|improve this answer
    
Thanks a lot every body. You help me more than I think:). I used \tabclosep{4.5pt} and my problem solved but in the out put in the top of my table wrote 4.5pt, and when I wrote \tabclosep{} my table's column is too near my numbers. I should write all the column in my table, too and I haven't permit to separate it. –  user60959 Aug 25 at 14:03
    
@user60959 : If you feel that an answer suits your needs you can accept it by pressing the "check" character at the left side of each answer. If you feel that an answer has something to offer in the community or you just want to express your gratitude you can upvote an answer, by clicking on the upper arrow at the left side of the answer. –  Thanos Aug 25 at 14:30

Thanks to Mico. Based on his suggestion the following wide table was constructed. However, I do not understand why \hline is not working except in the heading of the table. MyCode:

\documentclass[table]{article}
\usepackage[margin=0.5in]{geometry}
\usepackage{booktabs}
\usepackage{graphicx}
\usepackage{siunitx}

\begin{document}
\begin{center}
\textbf{Wide Table Construction}
\end{center}
\begin{table}[h]‎
\small
\noindent
\setlength\tabcolsep{4.5pt}
\begin{tabular*}{1.0\textwidth}{@{\extracolsep{\fill}}lrrrrrrccc @{}}
\hline 
‎‎‎h & ‎‎$‎‎‎50‎$‎‎ &A & ‎$‎‎‎100$ & C& ‎$‎‎‎500‎$&D&E&F&G‎ ‎\\ 
\hline
 ‎$‎h=.5‎‎$& $‎11.8860‎$  & $.736471 $ & $11.8904$ & $.888925$  & $11.898$ & $3.562203$  & ‎$‎5.7892‎$‎ ‎&‎$‎5.7918‎$‎& ‎$‎5.79‎26‎‎$ ‎\\‎‎
%\hline
 ‎$h=.25$ & $11.8877$&$.908528‎$‎ & $11.8921$ & $1.347235$ & $11.8956$ & $6.909139$  & ‎$‎5.7917‎$‎&‎‎$‎5.7943‎$‎&‎$‎5.7951‎$ ‎\\‎‎‎
%\hline‎
$h=.125$ & $11.8898$ & $1.800350$ & $11.8944$ & $2.689663$ & $11.8971$ & $14.014022$   & ‎$‎5.7932‎$‎&‎‎$‎5.7957‎$‎&‎$‎5.7965‎$ ‎\\‎‎‎
%\hline‎
 ‎$h=.0625$ & $11.8913$ & $4.274611$ & $11.8957$ & $6.344984$ & $11.8971$ & $28.677729 $ & ‎$‎5.7940‎$‎‎&‎$‎5.7965‎$‎&‎$‎5.7974‎$ ‎\\‎‎‎
%\hline‎
 ‎$h=.03125$ & $11.8921$ & $11.680354$ & $11.8965$ & $15.990138$ & $11.8979$ & $60.642217$  & ‎$‎5.7944‎$‎&‎$‎5.7970‎$‎&‎$‎5.7978‎$ ‎\\‎‎‎‎
%\hline‎
$h=.015625$ & $11.8926$ & $37.061820$ & $11.8970$ & $46.333275$ & $11.8984$ & $134.800034$ & ‎$‎5.7946‎$‎&‎‎$‎5.7972‎$‎&‎$‎5.7980‎$ ‎\\‎‎‎‎‎
% ‎\hline‎
 ‎$h=.0078125$ & $11.8928$ & $131.220405$ & $11.8972$ & ‎$‎147.617634$ & $11.8986$ & $324.236971$& ‎$‎5.7948‎$‎‎&‎$‎5.7973‎$‎&‎$‎5.7982‎$ ‎\\‎‎‎‎‎‎
%\hline‎
 ‎$h=.00390625$ & $11.8929$ & $488.012921$ & $11.8973$ & ‎$‎519.168699$ & $11.8987$ & $893.012911$ ‎‎‎& ‎$‎5.7948‎$‎‎&‎$‎5.7974‎$‎&‎$‎5.7982‎$ ‎\\‎‎‎‎‎‎‎
%‎\hline
 ‎$h=.001953125$ & $11.8930$ & $1889.675150$ & $11.8974$ & ‎$‎1953.356823$ & $11.8988$ & $2723.479288$& ‎$‎5.7949‎$‎&‎‎$‎5.7974‎$‎&‎$‎5.7982‎$ ‎\\‎‎
‎  \end{tabular*}‎
\hrule
\caption{‎statement}
‎ ‎\label{tab=4.11}‎
\end{table}

\end{document}

Output:

widetable

share|improve this answer
    
this isn't an answer to the question as asked, so it's not likely to get much attention here. however, i did look at the file, and it contains a lot of characters that don't show up in my editor window except as boxes indicating unrecognized characters. some of these come after the double backslash indicating end of row, and it's those that are keeping \hline from being properly recognized. they may be invisible in your editor window, but they're definitely there, so you need to put your editor in a mode that shows everything. –  barbara beeton Aug 25 at 14:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.