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 989495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:48:07+00:00 2026-05-16T05:48:07+00:00

I’m creating templates for a Django project, and I need to create a three

  • 0

I’m creating templates for a Django project, and I need to create a three column table in HTML, using just CSS, rather than a <table> element.

The reason, apart from any ideological opposition to tables, is that the report needs to be viewed on both desktops as well as handheld devices such as BlackBerry. On handhelds, rather than trying to force three columns on a minuscule screen, the objective is to break up the table into a series of consecutive paragraphs.

Previously, I’d hacked a quick/dirty template out using the Less framework (http://lessframework.com/).

            {% for category in article_list_categorised %}
                    <h2 class="first">{{ category.grouper }}</h2>
                            {% for item in category.list %}
                                    <h3 class="two first">{{ item.firms.all|join:", " }}</h3>
                                    <h4 class="two">{{ item.subject }}</h4>
                                    <p class="seven">
                                            {{ item.abstract }}
                                    </p>
                                    <h4 class="one">{{ item.source_publication }}</h4>
                                    <h4 class="one">{{ item.publication_date }}</h4>
                                    <h4 class="one">Page: {{ item.page_number }}</h4>
                            {% endfor %}
            {% endfor %}

            <footer>
                    <p class="four off-four">
                            {% now "l, jS F Y" %}
                    </p>
            </footer>

On screen, this gives a three column table, containing a list of articles. For each article (row), we have:

  1. First column contains the firm name
  2. Second column contains the subject and article abstract
  3. Third column contains the source publication, the publication date and the page number.

And when displayed on the BlackbBerry browser, it breaks up the columns in consecutive paragraphs, on top of each other.

Now, I want to move away from using Less to doing the markup/CSS from scratch.

I found another StackOverflow question asking something similar:

How to create three columns in css

and the advice from there is basically to use <ul> and <li>. I’ve hacked out something like this, two rows, three columns:

        <ul>
            <li> <!-- First row -->
                <ul>
                    <li>Deutsche Bank, Goldman Sachs JBWere</li>
                    <li>Costs</li>
                    <li>
                        <p>AAP</p>
                        <p>June 28, 2010</p>
                        <p>Page: 3</p>
                    </li>
                </ul>
            </li> <!-- End of first row -->
            <li> <!-- Second row -->
                <ul>
                    <li>Deutsche Bank</li>
                    <li>Plans</li>
                    <li>
                        <p>Bloomberg</p>
                        <p>June 29, 2010</p>
                        <p>Page: 1</p>
                    </li>
                </ul>
            </li> <!-- End of Second row -->
        </ul>

My question is, is this optimal, or is there perhaps a more streamlined hierarchy I could go for, or any tags I can strip out of the above?

Also, the article referenced in the above question talks about three columns, with one row. I need three columns, with a new row for each article.

What’s a good way of CSS styling the above, to give three columns, with each set on a new row, and still have it display as consecutive paragraphs on handhelds?

  • 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-05-16T05:48:08+00:00Added an answer on May 16, 2026 at 5:48 am

    Using an unordered list is not a BAD method, and the benefit of this is that devices or browsers with CSS disabled (yep, you’ll be surprised) will degrade gracefully into a legible list. If you wanted the above to display in a 3 column layout with each row on a new “line” I would try something like this for your css:

    First give your ul an ID attribute, so in our case we’ll call it <ul id="fakeTable">, and then we can style our li elements to act as table cells:

    #fakeTable, #faketable li{
      list-style-type:none; //no bullets etc
      margin:0;
      padding:0;
      }
    
    #fakeTable{
      width:800px; //you could set it to any width really, just an example
      }
    
    #fakeTable li{
      display:block;
      float:left;
      clear:none;
      width:200px;
      padding:0 11px 0 11px;
      }
    
    • Now assuming your <ul> is 800px wide, the <li> elements will wrap to the next line from 4 to 6, 7 to 9 etc as there is no more space to float a 4th one on each row.

    • If you do not have a set width, convert the widths to %, you could have the <li> width set to 33% – with no <li> padding of course – which will give you a width of 99% across 3 <li> elements, so no space for a 4th, and it will wrap to the next line!

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

Sidebar

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.