You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an issue where the table borders are misaligned when Chinese characters are included in the content. The presence of Chinese characters seems to disrupt the table’s layout, causing the borders to appear uneven, which affects the overall table formatting and presentation.
code:
fnmain(){use tabled::{Table, settings::Width};let data = vec![("Some\ndata","here","and here"),("Some\ndata on a next","line","right here"),];let table = Table::new(data).with(Width::list([20,10,12])).to_string();println!("{}", table);//Chinese and Englishlet data = vec![("一些\n数据","这里","和这里"),("Some\ndata on a next","line","right here"),];let table = Table::new(data).with(Width::list([20,10,12])).to_string();println!("{}", table);// All Chineselet data = vec![("一些\n数据","这里","和这里"),("一些\n数据在下一","行","就在那里"),];let table = Table::new(data).with(Width::list([20,10,12])).to_string();println!("{}", table);}
out:
The text was updated successfully, but these errors were encountered:
So you're right sometimes some characters play tricks with the layout....
But in most cases it's a terminal differences.
If you run it in a different terminal it may work or may not 😅
See for me it works.
This is actually an issue with how terminals treat UTF-8.
I do still think we probably need to have a way to address it....
For example having a different strategies for some terminals.
Likely most of them are using same approaches.
But it's something I was not thinking a lot about....
But we likely ought to.
We just need to do a bit of research, maybe you want to 😄 ?
So you're right sometimes some characters play tricks with the layout....所以,你有时候是对的,有些字符会对布局玩点小花招…… But in most cases it's a terminal differences.但大多数情况下,这是终端差异。 If you run it in a different terminal it may work or may not 😅如果您在不同的终端中运行它,它可能工作也可能不工作 😅
See for me it works.为我看看它是否工作。
This is actually an issue with how terminals treat UTF-8.这是一个终端处理 UTF-8 的问题。 I do still think we probably need to have a way to address it....我仍然认为我们可能需要有一种方法来解决这个问题……
For example having a different strategies for some terminals.例如,为某些终端制定不同的策略。 Likely most of them are using same approaches.很可能他们大多数都在使用相同的方法。
But it's something I was not thinking a lot about....但是这并不是我思考很多的事情.... But we likely ought to.但我们可能应该。
We just need to do a bit of research, maybe you want to 😄 ?我们只需要做一点研究,也许你想😄?
Thank you for your reply 😊. My previous output was from the run output of RustRover. I changed the output in the run configuration to simulate the terminal, and it worked fine. I tested several common terminals, and they all displayed correctly.
I encountered an issue where the table borders are misaligned when Chinese characters are included in the content. The presence of Chinese characters seems to disrupt the table’s layout, causing the borders to appear uneven, which affects the overall table formatting and presentation.
code:
out:
The text was updated successfully, but these errors were encountered: