The table produced by this code always goes out off the width of my page. I want the table to fit within the width of the page. I tried giving extra \\
in between but it made it worse only.
\begin{tabular}{|l|l|}
\hline
LocationProvider & Description \\
\hline
network & Uses 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{tabular}
The result:
Best Answer
"l" means left aligned so everything in the cell comes out in a single row and if you have a lot of material you end up exceeding the available width on your page.
Alternatives:
p{<width>}
on one or more columns to have the text inside wrap the the specified<width>
tabularx
which allows you to get the column width for wrapping columns be determined automatically (see package documentation how to do this)