Whether it’s tabled or not will entirely depend on what font is being used. Even if it’s the default one, the letters are not monowidth, and therefore it is difficult to perfectly line up text, and involves special space characters which may not display on all systems.
As @RandomByte suggested, my ChatUI plugin should be able to render a table like you wanted.
The ‘force unicode’ option currently breaks the plugin but I am working to improve support.
Edit:
I just made a quick example.
It renders outside of the framework i.e. creates a standalone Text object instead of drawing to a Tab
TableModel model = new SimpleTableModel(new Object[][] {
{"text1", "text2", "tttext3"},
{"text1", "a", "b"}
});
TableRenderer renderer = new BorderlessTableRenderer();
TableUI table = new TableUI(model, renderer);
// Hard coded because we're rendering outside of the framework
PlayerContext ctx = new PlayerContext(this.player, 320, 10, false);
this.player.sendMessage(table.draw(ctx));
Sorry to bring back a dead thread, but is there any way to do this without using ChatUI? @simon816 is there a code snippet you can share? Is there a way to change a user’s font to a monospaced version?
Looks like you’ve found the relevant part of Chat UI, so you can go from there.
Since my last post, I have branched Chat UI out into a separate UI library - simon816 / Chat UI Library
This is designed to be usable by plugins and handles the low-level text manipulation, without needing the tabbed interface from Chat UI.