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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:43:42+00:00 2026-05-11T17:43:42+00:00

I have some data with one row of headers and one or more rows

  • 0

I have some data with one row of headers and one or more rows of values that I want to display. Currently, I’m using an HTML table, but I’ve come across situations where I have so many columns, the table goes off the end of the screen. Or that some column names are so long (they’re usually just a single word that have underscores as spaces), even if there aren’t that many columns, the table still goes off the end of the browser window.

What I want is to be able to display all data without having to scroll horizontally. Even if that means breaking the data up into multiple tables.

I’m currently using Embedded Perl, and one hackish solution I’ve used is to just hardcode 8 columns per table, and start a new table under the first if necessary. But ideally, what I want is to dynamically put as many columns as possible on one table, and wrap to a new line of rows/tables/whatever if necessary.

Can this be done HTML/CSS-only? Or do I need to somehow calculate how much width each column will take, and base my number of columns per table on that? I don’t have to use HTML tables, so if there’s a better solution, I’m more than willing to use it.

  • 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-11T17:43:42+00:00Added an answer on May 11, 2026 at 5:43 pm

    Using table { display: inline; } combined with one table per column should solve your problem. Run this and load the output in a web browser. When you resize the window the columns that won’t fit drop down. You might want to use a class with the tables if you don’t want all tables affected.

    #!/usr/bin/perl
    
    use strict;
    use warnings;
    
    print "<html><head><style>table { display: inline }</style></head><body>";
    for my $col (1 .. 100) {
        print "<table><tr><th>$col</th></tr>";
        for my $row (1 .. 10) {
            print "<tr><td>$row</td></tr>";
        }
        print "</table>";
    }
    print "</body></html>";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some data. I want to go through that data and change cells
I have some data that I want to store somewhere in my Rails app
I have a script that appends some rows to a table. One of the
I have 2 tables, one that holds records with some data related to it
I have some data stored as ArrayList . And when I want to backup
We have some input data that sometimes appears with &nbsp characters on the end.
i have a question regarding some complex data-binding. I want to be able to
I have a stored procedure, that generates some columns dynamically. I want to use
I have some data formatted into a table. I want to setup an onclick
I have got a table which is coming with some data. One of the

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.