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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:56:34+00:00 2026-05-22T11:56:34+00:00

I have a table where the content of one column is often narrower than

  • 0

I have a table where the content of one column is often narrower than the column itself. I would like the content of this column to be centred like so:

-----------------
| Column Header |
-----------------
|    Content    |
|    Content    |
|    Content    |
-----------------

A quick search turned up the solution of placing the content in a div with style="diplay:table; margin:auto", however this does not work in IE6/7 as they do not recognise table as a display mode. I would prefer to avoid explicitly setting width as the size of the content may vary.

Is there a hack to make this display the same way in IE6/7? Alternatively, is there a different approach which works across IE6/7 and all the major browsers?

EDIT: I cannot use text-align:center; as the content is not plain text.

EDIT 2: Here is simple example in jsFiddle: http://jsfiddle.net/KK5Bp/. The button appears centred under the heading in sane browsers, but is still left aligned in IE6/7. I would like it to appear the same way in IE6/7 as well.

  • 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-22T11:56:35+00:00Added an answer on May 22, 2026 at 11:56 am

    Have you tried text-align: center on <div> inside the relevant table cells?

    <table>
        <thead>
            <tr>
                <th>Very Long Header</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>
                    <div style="text-align: center">
                        <button name="short">short</button>
                    </div>
                </td>
            </tr>
        </tbody>
    </table>
    

    text-align:center should work the same in every browser.

    http://jsfiddle.net/ambiguous/NYYwd/

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

Sidebar

Related Questions

I have a table structure looking something like this. One outer table and in
I have one table which display data as from Dynamic Content in 1 column.
I have a table in which in one column some content is initially hidden,
I have two table cells, with dynamic content. Table cell one works fine, when
I have two tables, content and images (and a ContentImages table for the one
I have Table: ARTICLES ID | CONTENT --------------- 1 | the quick 2 |
I have a posts table structured this way: id | title | content |
I have a HTML table. Each cell has content of different length. For this
SSRS newbie question here... I have a table where one column is varbinary(max) data.
The question is similar to this one: How to display a content in two-column

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.