I'm new to latex so pardon me. My table width is not fitting. It's extending beyond the screen

Here is my code:

\begin{table}[H]
\begin{tabular}{|l|l|}
\hline
some randome text. \\ \hline
\end{table}
\end{tabular}

tried using \tablularx but didn't work :(. What am I doing wrong please?

  • 2
    Possible duplicate of My table doesn't fit; what are my options? – Werner Dec 7 at 1:33
  • 1
    Welcome to TeX.SX! Please extend your code to a full but minimal document that replicates the problem – siracusa Dec 7 at 1:37
  • 1
    Welcome to Te.SX! What does "not fitting" mean in this context? You are defining a code with two left justified columns and it will be just "wide enough" to fit your "some random text" and an empty column. Do you want it wider or narrower? As siracusa says, you should also expand your code to a minimal working example. This is a minimal piece of compilable code that demonstrates your problem. This will make it much easier to hep you and it will clarify your problem. – Andrew Dec 7 at 1:51
  • Unrelated to your problem, but better not use [H]. This is basically a guarantee for bad placement. Better use [htbp] – samcarter Dec 7 at 2:43
  • 1
    You defined two colums l but your table has only one. If you use tabularx you have to use also an X column. Otherwise, just use p{...} column (where ... is your desired width) – CarLaTeX Dec 7 at 4:29

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.