python-tabulate icon indicating copy to clipboard operation
python-tabulate copied to clipboard

Control handling of new lines

Open johann-petrak opened this issue 9 months ago • 0 comments

It would be very useful to have a parameter which allows for setting a global or per-column strategy of how to handle newlines within the values to be shown in the table.

The strategies I would find most useful are:

  • escape: instead of adding the newline as is, replace it with the string "\n"
  • br: instead of addingthe newline as is, replace it with the string "
    "
  • space: replace the newlines with a space

Currently this has to be done by a manual preprocessing step of the table data, but allowing for delegation to the tabulate library would be very useful.

johann-petrak avatar Mar 25 '25 08:03 johann-petrak