I use report class and I have just started working with tables. I have created one:
\begin{table} [ht]
\centering
\caption{Ut convallis pharetra augue at aliquet}
\label{table1_disc_log}
\small
\begin{tabular}{ |p{4cm} || p{5cm} | p{5cm} | }
\hline\hline
\textbf{Ut convallis} & \multicolumn{2}{|c|}{\textbf{Lorem ipsum dolor sit amet}}\\
\cline{2-3}
\ & Ut convallis pharetra & Consectetur adipisci veliturea \\
\hline
Lorem ipsum dolor sit amet & \centering $O(n)$ & Lorem ipsum dolor \\
\hline
Veliturea adipiscing, consectetur adipisci & \centering $O(\sqrt{n})$ & Lorem ipsum \\
\hline
$\rho$--Pollard method & \centering $O(\sqrt{n})$ & Lorem ipsum dolor \\
\hline
Pharetra augue at aliquet, consectetur adipisci &
\centering $O\left(\left(\sum_{i=1}^rk_i\left(\sqrt{p_i} + \ln p \right) \right)\ln^2p \right)$ &
Ut convallis pharetra augue at aliquet, consectetur \\
\hline
Adipiscing elit, ut convallis & \centering $L_p\left[\frac{1}{3},const\right]$ &
Lorem ipsum dolor sit amet, consectetur adipisci (ut convallis pharetra augue at aliquet, consectetur) \\
\hline\hline
\end{tabular}
\end{table}

Unfortunately, I haven't found a clear explanation how to adjust some of its elements. So there are my questions:
How could I horizontally center the text in some cells? I have tried
\centeringin cells, but it doesn't work with all table cells. For example, I need to center the headers of two columns: 'Ut convallis pharetra' and 'Consectetur adipisci veliturea', how can I manage that?Why didn't the text in the first cell automatically become vertically centered? Additionally, how to make it horizontally centered at the same time?
How could I set text margins for cells (in general, custom for some columns and custom for some cells)? How to set custom height for some rows? (higher than the text inside of it.)
How could I set default text alignment for the whole table ('on top of the cell', or 'on center of the cell'.) How could I change this behaviour for some particular columns or cells?
How to make an empty cell? I had to use
\(space), otherwise there was an error.

m{..}instead ofp{..}columns. I've also used\mathrm{..}for text in math mode (although you could consider usingamsmath's\text{..}macro. – Werner Apr 17 '12 at 21:13