2

I'm going to need to display a list of results as a response from a telegram bot I'm working on, and was wondering what's the best way of doing that...

I could "calculate" the amount of spaces I need to make it look semi-normal, but I'd rather have a better solution, if there is one.

Thanks!

trueicecold
  • 820
  • 10
  • 23

3 Answers3

2

So, the closest solution I could find is using "pre" inside the bot message (assuming it has parseMode=html), since the characters are all the same width.

I won't be using it eventually, but that's my 2 cents..

trueicecold
  • 820
  • 10
  • 23
0

i prefer generating HTML table as file and then convert it to an image with some tools, and finally send the image to user by sendPhoto method. by this method i can create a beautiful colored table with many options...

علیرضا
  • 2,434
  • 1
  • 27
  • 33
0

I have used a PHP library to generate a tabular structure, then used <pre> tag to keep the spacing as it is as suggested by trueicecold

  • Welcome to SO! Is it possible to post some code along with a screenshot of the table illustrating how the spacing is preserved? – Laurie Stearn Mar 26 '20 at 02:46