Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8116359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:48:21+00:00 2026-06-06T03:48:21+00:00

I am looking to create something that resembles a table in Tkinter but it

  • 0

I am looking to create something that resembles a table in Tkinter but it doesn’t necessarily have to be one.

I would like to create headers ‘Name1’, ‘Name2’, ‘Value’ for example and beneath each one I wish to have several blank rows.

These rows I then wish to fill in later (therefore a Label) with values I have calculated or string values for names.

For ‘Name2’ I would actually like for the entire column to be a drop down menu. I have already created the code for one on it’s own but am not sure how to incorporate it into this ‘table’.

Is it for example possible to create a border around a Label widget so it looks like a ‘table’?

Any pointers towards what would be possible in this situation would be very much appreciated. If you require any of my code to have a go at something, just ask. Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T03:48:25+00:00Added an answer on June 6, 2026 at 3:48 am

    What problem are you having? The simple solution is to lay out widgets using grid. You can put whatever type of widget you want in each cell. And yes, labels can have borders. Though, a simple way to do grid lines is to use a padding around each cell, so that the color of the frame will show through the gaps.

    Do this in a frame. If you need to be able to scroll the table, put the frame inside a canvas and add scrollbars. There are examples all over the web for how to create a scrollable frame using a canvas.

    Here’s a really quick example that uses just labels, and doesn’t scroll. I’ll leave the exact implementation of what you need as an exercise for the reader.

    import Tkinter as tk
    
    class ExampleApp(tk.Tk):
        def __init__(self):
            tk.Tk.__init__(self)
            t = SimpleTable(self, 10,2)
            t.pack(side="top", fill="x")
            t.set(0,0,"Hello, world")
    
    class SimpleTable(tk.Frame):
        def __init__(self, parent, rows=10, columns=2):
            # use black background so it "peeks through" to 
            # form grid lines
            tk.Frame.__init__(self, parent, background="black")
            self._widgets = []
            for row in range(rows):
                current_row = []
                for column in range(columns):
                    label = tk.Label(self, text="%s/%s" % (row, column), 
                                     borderwidth=0, width=10)
                    label.grid(row=row, column=column, sticky="nsew", padx=1, pady=1)
                    current_row.append(label)
                self._widgets.append(current_row)
    
            for column in range(columns):
                self.grid_columnconfigure(column, weight=1)
    
    
        def set(self, row, column, value):
            widget = self._widgets[row][column]
            widget.configure(text=value)
    
    if __name__ == "__main__":
        app = ExampleApp()
        app.mainloop()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im looking to create a control that would look like comic baloon. In WPF
I am looking for python stubbing library. Something that could be used to create
I want to round specific corners of buttons to create something like mx.controls.ButtonBar. But
I want create something that looks like the MSN Messenger chat forms. I am
I would like to create a visualizer for the windows system audio. I'm looking
In a DB I'm designing, there's one fairly central table representing something that's been
Recently I've been looking to create some way of showing a user that something
I'm looking for some tool that can be used to create .chm (or something
In my create script for my database create script looking something like this: CREATE
I looking to create a custom calender with Zend Framework, I am hoping that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.