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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:39:03+00:00 2026-05-16T18:39:03+00:00

Suppose I have table with two columns. I can center this table by using:

  • 0

Suppose I have table with two columns. I can center this table by using:

margin: auto

But let’s say I want second column to appear in the center. How do I do that?
Is it possible?

Edited:

Here is what I want to achieve:

-------------------------------------------------------
|                                                     |
|     ----------------------------------              |
|     |1 column|        2column        |              |
|     |1 column|        2column        |              |
|     |1 column|        2column        |              |
|     |1 column|        2column        |              |
|     |1 column|        2column        |              |
|     ----------------------------------              |
|                                                     |
|                                                     |
-------------------------------------------------------

Second column is in the center of page/div. If this is impossible with tables how to do it with divs?

  • 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-16T18:39:04+00:00Added an answer on May 16, 2026 at 6:39 pm

    Well you can, although I have to warn you there are several problems with a layout like this. Be sure to understand them before using this.

    The HTML required is:

    <div id="container">
        <div id="inside">
            <div id="offside">
            </div>
            <div id="center">
            </div>
        </div>
    </div>
    

    There are two layers of wrappers here. We using the usual margin: 0 auto technique with the outside container to center it, while the inside div gets a negative left margin equal to the width of the off-center div.

    #container {
        width: 300px;
        margin: 0 auto;
    }
    
    #container #inside {
        margin-left: -100px;
        overflow: hidden;
    }
    
    #container #inside div {
        float: left;
        height: 400px;
    }
    
    #container #inside #offside {
        width: 100px;
        background-color: #ddd;
    }
    
    #container #inside #center {
        width: 300px;
        background-color: #f9f9f9;
    }
    

    Have a look at it here: http://www.jsfiddle.net/DfArr/1/

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

Sidebar

Related Questions

Suppose I have two columns in a table that represents a graph, the first
I have a table Template with following columns: ID, [Text] Suppose I have two
Suppose we have a PostgreSQL database with two tables A, B. table A columns:
I want to have one table with two TIMESTAMP columns. One column to keep
Suppose we have a table of numbers like this (we can assume it is
Suppose I have a table TABLE with two columns COL_1 and COL_2 . I
I am working with SQLite. Suppose I have a table sales with two columns,
Suppose I have a tags table with two columns: tagid and contentid . Each
Can you pivot two columns in a pivot query. Suppose I have the following
Suppose we have two tables Foo and Bar. I have an association table Foo_Bar

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.