-
-
Notifications
You must be signed in to change notification settings - Fork 79
Open
Labels
Description
Hi there,
If I enable word wrap with columns that have emoji in them, it eats the first letter of the word on the line below... I assume this has something to do with full width calculations.
Example
const table = require("table");
const works = [
["Name", "Number"],
["Some Text", 24],
["Some more text", 22],
["I am a reallylong name", 19],
["I have a super duperlongname", 18],
];
const doesntwork = [
["Name", "Number"],
["π₯ Some Text", 24],
["π₯ Some more text", 22],
["π₯ I am a reallylong name", 19],
["I have a super duperlongname", 18],
];
const config = {
columns: [
{ alignment: "left", width: 15, wrapWord: true },
{ alignment: "right", width: 10, wrapWord: true },
],
header: { alignment: "center", content: "My Table", wrapWord: true },
};
console.log(table.table(works, config));
console.log(table.table(doesntwork, config));Results
ββββββββββββββββββββββββββββββββ
β My Table β
βββββββββββββββββββ¬βββββββββββββ’
β Name β Number β
βββββββββββββββββββΌβββββββββββββ’
β Some Text β 24 β
βββββββββββββββββββΌβββββββββββββ’
β Some more text β 22 β
βββββββββββββββββββΌβββββββββββββ’
β I am a β 19 β
β reallylong name β β
βββββββββββββββββββΌβββββββββββββ’
β I have a super β 18 β
β duperlongname β β
βββββββββββββββββββ§βββββββββββββ
ββββββββββββββββββββββββββββββββ
β My Table β
βββββββββββββββββββ¬βββββββββββββ’
β Name β Number β
βββββββββββββββββββΌβββββββββββββ’
β π₯ Some Text β 24 β
βββββββββββββββββββΌβββββββββββββ’
β π₯ Some more β 22 β
β ext β β
βββββββββββββββββββΌβββββββββββββ’
β π₯ I am a β 19 β
β eallylong name β β
βββββββββββββββββββΌβββββββββββββ’
β I have a super β 18 β
β duperlongname β β
βββββββββββββββββββ§βββββββββββββ
Do you have any idea how to remedy this?
Thanks for making this library. It's of great use to me π