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

  • Home
  • SEARCH
  • 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 7795903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:12:20+00:00 2026-06-01T23:12:20+00:00

I have a python list that looks like this example: [[‘ 1’, ‘ 200’,

  • 0

I have a python list that looks like this example:

[[' 1', ' 200', ' 30', ' item a'], [' 1', ' 500', ' 20', ' item b']]

This is then passed through to the template in django.

I am trying to generate a table using this data:

Each internal bracket (there are 2 in this example: [' 1', ' 200', ' 30', ' item a'] and [' 1', ' 500', ' 20', ' item b'] ) need to be in a new line in the table. So for this example, there would be 2 rows.

Each field within the internal brackets has to go in a new column in the table.. So this table will have 4 columns and 2 rows.

  • 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-01T23:12:22+00:00Added an answer on June 1, 2026 at 11:12 pm

    The basic template tag you need is the for tag:

    {% if my_list %}
        <table>
        {% for row in my_list %}
            <tr>
            {% for item in row %}
                <td>{{ item }}</td>
            {% endfor %}
            </tr>
        {% endfor %}
        </table>
    {% endif %}
    

    I also use an if tag so you don’t end up with an empty set of table tags if there are no rows in the list.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have a Python list that looks like this: list = [
I have a python class that looks like this: class Process: def __init__(self, PID,
I have a Python 2.x module.py file that looks like this: class A(object): KEYWORD
(Sorry if it's a trivial question.) I have documents that looks like this (Python
I have passed Python list to template like l=['text','there is no salary','I need alcohol','and
Say I have a string that looks like this: str = The &yquick &cbrown
I have a disordered list named d that looks like: [0.0000, 123.9877,0.0000,9870.9876, ...] I
I have Python nested list that I'm trying to organize and eventually count number
I have a Python list that I'm supplying to the template: {'error_name':'Please enter a
I have a list of Python objects that I want to sort by a

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.