How do I put preformatted text into a FitNesse fixture table cell?

Use !- -! to get multiline table cells and {{{ }}} to get preformatted text. The {{{ has to be outside the !-

For example:

|sql|
|{{{!- SELECT *
     FROM bar
     WHERE gaz = 14
-!}}}|

richard's comment on Johannes Brodwall's answer worked for me, i.e. you don't need the "formatted 'as is'" line/block markup, just the "'as-is'/escaping" character formatting so the following is sufficient if you don't need or want the pre-formatted style too:

|sql|
|!-Some text
that spans
multiple lines.
-!|

This way allows you to keep a table row on the same line in your source code :

| col1 | col2 |
| !- col1 cell <br /> with line break -! | col2 cell without line break |

One way to do this is to define a variable with the multi-line text and then refer to this from the table cell:

!define sql {  SELECT *
  FROM bar
  WHERE gaz = 14
}

|sql|
|${sql}|

Tags:

Fitnesse