Answer the question
In order to leave comments, you need to log in
How to place inline buttons horizontally?
There is a python code that displays inline buttons with information from the database (sqlite3):
keyboard = types.InlineKeyboardMarkup(row_width=2)
for .... in .... :
q.execute("SELECT name FROM categors where id = " + str(bb))
r = q.fetchone()
keyboard.add(types.InlineKeyboardButton(text=str(r[0]),callback_data='categ_'+str(bb)))
bot.send_message(message.chat.id, "Выбери категорию: ", reply_markup=keyboard)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question