Results 1 to 3 of 3

Math Help - what's wrong with this table?

  1. #1
    Senior Member
    Joined
    Feb 2008
    Posts
    321

    what's wrong with this table?

    \begin{tabular}[t]{|l|ccccc|c|}
    \multicolumn{7}{c}{table of basic solutions}\\\hline
    $&\x_{1}&\x_{2}&\x_{3}&\x_{4}&\x_{5}&f $\\ \hline
    A&4&0&-4&0&-3&4\\
    B&2&0&0&2&-1&2\\
    C&1&0&2&3&0&1\\
    D&0&0&4&4&1&0\\
    E&0&-1&5&6&0&-1\\
    F&0&2&2&0&3&2\\
    G&0&4&0&-4&5&4\\
    H&$\frac{4}{3}&\frac{4}{3}&0&0&1&\frac{8}{3}$\\
    I&2&1&-1&0&0&3\\
    J&$\frac{5}{3}&\frac{2}{3}&0&1&0&\frac{7}{3}$\\\hl ine
    \end{tabular}

    it stopped at the line in red.
    it says: extra }, or forgotten $.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Super Member flyingsquirrel's Avatar
    Joined
    Apr 2008
    Posts
    802
    Hello,

    This code should work :

    Code:
    \begin{tabular}[t]{|l|ccccc|c|}
    \multicolumn{7}{c}{table of basic solutions}\\\hline
    &$x_{1}$&$x_{2}$&$x_{3}$&$x_{4}$&$x_{5}$&$f $\\ \hline %modified
    A&4&0&-4&0&-3&4\\
    B&2&0&0&2&-1&2\\
    C&1&0&2&3&0&1\\
    D&0&0&4&4&1&0\\
    E&0&-1&5&6&0&-1\\
    F&0&2&2&0&3&2\\
    G&0&4&0&-4&5&4\\
    H&$\frac{4}{3}$&$\frac{4}{3}$&0&0&1&$\frac{8}{3}$\\ %modified
    I&2&1&-1&0&0&3\\
    J&$\frac{5}{3}$&$\frac{2}{3}$&0&1&0&$\frac{7}{3}$\\ \hline %modified
    \end{tabular}
    I've added extra $ where needed : in each cell of the table where you use \frac{}{} or x_{}. You can't set a whole line of a table in math mode simply by enclosing it into to $. Instead, you have to enclose the content of each cell by $. I've also replaced every \x_{} by x_{} on line 3 (that may not be what you want if you did define the command \x ...).

    If every cell of the table must be in math mode, you can use array instead of tabular. Every cell of an array is in math mode so there is no need to use the symbol $. The following code gives the table on the attached picture (note that the first column is in italic font which, again, may not be what you want).

    Code:
    \begin{array}[t]{|l|ccccc|c|}
    \multicolumn{7}{c}{\text{table of basic solutions}}\\\hline
    &x_{1}&x_{2}&x_{3}&x_{4}&x_{5}&f \\ \hline %modified
    A&4&0&-4&0&-3&4\\
    B&2&0&0&2&-1&2\\
    C&1&0&2&3&0&1\\
    D&0&0&4&4&1&0\\
    E&0&-1&5&6&0&-1\\
    F&0&2&2&0&3&2\\
    G&0&4&0&-4&5&4\\
    H&\frac{4}{3}&\frac{4}{3}&0&0&1&\frac{8}{3}\\ %modified
    I&2&1&-1&0&0&3\\
    J&\frac{5}{3}&\frac{2}{3}&0&1&0&\frac{7}{3}\\ \hline %modified
    \end{array}
    Attached Thumbnails Attached Thumbnails what's wrong with this table?-table_array.png  
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Senior Member
    Joined
    Feb 2008
    Posts
    321

    thx

    this works! thx.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. [SOLVED] am I wrong here or is my textbook wrong??
    Posted in the Algebra Forum
    Replies: 5
    Last Post: September 25th 2011, 06:13 PM
  2. Replies: 3
    Last Post: March 26th 2011, 06:35 AM
  3. Replies: 6
    Last Post: August 12th 2009, 03:15 AM
  4. Wrong answer key or wrong me ?
    Posted in the Algebra Forum
    Replies: 2
    Last Post: July 2nd 2008, 05:42 AM
  5. table salt + table sugar
    Posted in the Math Topics Forum
    Replies: 2
    Last Post: September 9th 2007, 09:35 AM

Search Tags


/mathhelpforum @mathhelpforum