0
Here is an example table with 4 columns.
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.recycleview import RecycleView
from kivy.uix.boxlayout import BoxLayout
items = [
{'1': 'Nome', '2': 'Telefone', '3': 'Cidade', '4': 'N. Pedido'},
{'1': 'Paulo Souza', '2': '(81) 988754-8855', '3': 'Petrolina', '4': ''},
]
class Tabela(BoxLayout):
pass
Builder.load_string('''
<Tabela>:
orientation: 'horizontal'
col1: 'column1'
col2: 'column2'
col3: 'column3'
col4: 'column4'
Label:
id: label1
text: root.col1
Label:
id: label2
text: root.col2
Label:
id: label3
text: root.col3
Label:
id: label4
text: root.col4
<RV>:
viewclass: 'Tabela'
RecycleBoxLayout:
default_size: None, dp(20)
default_size_hint: 1, None
size_hint_y: None
height: self.minimum_height
orientation: 'vertical'
''')
class RV(RecycleView):
def __init__(self, **kwargs):
super(RV, self).__init__(**kwargs)
self.data = [{'col1': str(x['1']), 'col2': str(x['2']), 'col3': str(x['3']), 'col4': str(x['4'])} for x in items]
class TestApp(App):
def build(self):
return RV()
if __name__ == '__main__':
TestApp().run()