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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:51:22+00:00 2026-05-12T16:51:22+00:00

I would like to ask what is the better way of specifying HTML column

  • 0

I would like to ask what is the better way of specifying HTML column width? the width attribute or the style attribute? Assuming I am using IE 6. Does IE render the width attribute better than style?

By width attribute

<table width="900">
    <tr>
        <td width="450">A</td>
        <td colspan="2" width="450">B&C</td>
    </tr>
    ....
</table>

OR by style attribute

<table style="width:900px;">
    <tr>
        <td style="width: 450px;">A</td>
        <td colspan="2" style="width: 450px;">B&C</td>
    </tr>
    ....
</table>
  • 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-12T16:51:22+00:00Added an answer on May 12, 2026 at 4:51 pm

    Firstly before I answer your question, something you should know is how tables are rendered, experiment with the table-layout fixed style for the table element:

    If the browser knows the width of the first table row columns upfront (if you provide the table layout fixed style on the table) the browser can begin rendering the top of the table even before its calculated the width of any resulting rows. What this means? Tables populated by Ajax calls with a fixed layout can begin displaying results to a user before the full ajax call is finished. Best way to think of this is like a progressive jpg. In the end your pages will appear to load faster.

    table
    {
    table-layout:fixed;
    }
    

    Now to answer your question.

    Actually neither example you provided is correct. you typically do not set width on a cell that is spanned across 2 or more cells. In any table its a good idea to create at least 1 row with all the cells, this can either be in the TH or (just the way I like to do it in a blank tr.

    For example…

    <table>
    <tr>
    <td width="450"></td>
    <td width="225"></td>
    <td width="225"></td>
    </tr>
    <tr>
    <td>content here</td>
    <td colspan="2">content here</td>
    </tr>
    </table>
    

    What ever way you decide to use style or just standard html width, the choice is yours, but in the end you should have your first row (if table layout is fixed) or any row (if table layout is not fixed) to contain the width definition for each invidivual cell. This will also help you with planning the correct looking table, hope this helps.

    Test the table layout fixed, by creating a huge like 10 000 row table, and test the rendering speed vs a non fixed table layout.

    The whole debate about HTML 4 vs XHTML , style vs attributes I think is really a question of maintainability. I don’t think there is anything wrong setting the width using Style or plain width with HTML 4 transitional, they both do the same thing. The reason why you can do both is because HTML has evolved a bit, yes it can get messy! Good luck

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

Sidebar

Related Questions

I would like to ask, is there a better way to run this code.
I would like ask if there's a way to download an android layout from
i would like to ask what is the best way to make simple iteration.
I'm a JavaScript noob and would like to know if there's a better way
I would like to ask about best practices or the simplest way possible of
What I would like ask is best illustrated by an example, so bear with
I would like to ask you: Imagine that you have a site and there
I would like to ask such question, I have XML xsd`s, which generate beans
I would like to ask, how can I define class inside another one. In
I would like to ask you about regular expressions preg_match have outlined below. I

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.