Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

LaTeX Tables in latex?

  1. Apr 28, 2016 #1

    anorlunda

    Staff: Mentor

    I used a table generator site http://www.tablesgenerator.com/ to create this latex code, but it doesn't work in a thread when I paste it in between dollar dollar delimiters.

    Help please.

    $$
    \begin{table}[]
    \centering
    \caption{My caption}
    \label{my-label}
    \begin{tabular}{ll}
    1 & TW base \\
    1 & TW reserves \\
    2 & TW total \\
    3 & \$/watt utility \\
    6 & \$/watt rooftop \\
    6.5 & \$trillion storage \\
    \$14 & \$trillion total
    \end{tabular}
    \end{table}
    $$
     
  2. jcsd
  3. Apr 28, 2016 #2

    DrDu

    User Avatar
    Science Advisor

    Have you tried two hashes instead of two dollars?
     
  4. Apr 28, 2016 #3

    anorlunda

    Staff: Mentor

    Here it is with hashes.

    ##
    \begin{table}[]
    \centering
    \caption{My caption}
    \label{my-label}
    \begin{tabular}{ll}
    1 & TW base \\
    1 & TW reserves \\
    2 & TW total \\
    3 & \$/watt utility \\
    6 & \$/watt rooftop \\
    6.5 & \$trillion storage \\
    \$14 & \$trillion total
    \end{tabular}
    \end{table}
    ##
     
  5. Apr 28, 2016 #4

    DrDu

    User Avatar
    Science Advisor

    apparently, Tabular is not implemented in Mathjax.
     
  6. Apr 28, 2016 #5

    anorlunda

    Staff: Mentor

    Darn. Is there any way to get tables into a PF post?
     
  7. Apr 28, 2016 #6

    DrDu

    User Avatar
    Science Advisor

    Maybe html?
     
  8. Apr 28, 2016 #7

    ShayanJ

    User Avatar
    Gold Member

    Use
    Code (Text):

    \ begin{array}{ll}

    \ end{array}
     
    (With no space after \, I put it their because it becomes invisible when I write it the correct way!)
     
  9. Apr 28, 2016 #8

    anorlunda

    Staff: Mentor

    Yes, thank you @Shyan That got me closer, now I'll try to get rid of centering the cells.

    ##
    \begin{array}{7}
    1 & TW base \\
    1 & TW reserves \\
    2 & TW total \\
    3 & \$/watt utility \\
    6 & \$/watt rooftop \\
    6.5 & \$trillion storage \\
    \$14 & \$trillion total
    \end{array}
    ##
     
  10. Apr 28, 2016 #9

    ShayanJ

    User Avatar
    Gold Member

    \begin{array}{ll} 1 & TWbase \\ 1 & TWreserves \\ 2 & TWtotal \\ 3 & \$wattutility \\ 6 & \$wattrooftop \\ 6.5 & \$trillionstorage \\ 14 & \$trilliontotal \end{array}

    Do you exactly write \ begin{array}{ll} ? The second l is supposed to align the text to the left!

    P.S.
    This may be helpful.
     
  11. Apr 28, 2016 #10

    anorlunda

    Staff: Mentor

    Double thanks @Shyan. Got it.
     
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted