I'm working with a "Books" table in Material UI. It has 3 columns: "Book Number", "Title", and "Chapters". I would like each chapter to be displayed in individual lines like list items, like so:
Chapter 1
Chapter 2
Chapter 3
and not
Chapter 1 Chapter 2 Chapter 3
I tried different approaches such as adding "\n", storing it in variable, and/or enclosing it in a template literal, like so:
const row2 = "Chapter 1\nChapter 2";
const row4 = `Chapter 1\nChapter 2\nChapter 3`;
const rows = [
createData("1", "Book 1", "Not Applicable"),
createData("2", "Book 2", row2),
createData("3", "Book 3", "Chapter 1\nChapter 2"),
createData("4", "Book 4", row4)
];
Here's the complete code.
