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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:33:50+00:00 2026-05-26T15:33:50+00:00

td width is 162px even though style=width:25px for td and th I’ve put this

  • 0

td width is 162px even though style=”width:25px” for td and th

I’ve put this in my css file

table, td, th {
    border: 1px solid black;
}
table {
    border-collapse:collapse;
}

table.narrow th, td {
    width:50px;
}

It doesn’t work. The last one there is supposed to take a table with class=”narrow” and make all its descendent th and td elements 50px wide. And chrome shows Matched CSS Rules:

.narrow th, td { width: 50px; }

So chrome is reading it and ignoring it? Or CSS is just idiotic? Or I am? Why can’t CSS just do what you tell it, like a normal programming language?

SO, I tried putting style=”width:25px” right in the 1st column td AND th tags and still, doesn’t work. Chrome shows:

element.style { width:25px; } 

but it won’t tell me why the hell it’s displaying it at 162px.

Anyone have any clues?
Thank you.


Edit: Kolink gave me the clue I needed. Form text fields inside the tags were causing a large minimum width. I added this style to shrink the table:

.narrow input{
  width:80px;
}

It reduced the width of all the inputs inside the class=”narrow” table and hence reduced the width of the 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-26T15:33:51+00:00Added an answer on May 26, 2026 at 3:33 pm

    Set table-layout: fixed; on the table’s styles. Otherwise table layout is loose and width is treated more like min-width.

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

Sidebar

Related Questions

So far, I'm doing this programmatically using VB.net/ASP.net: <table cellspacing=0 cellpadding=4 border=0 style=border- width:0px;width:100%;border-collapse:collapse;font-size:12px;>
This is css to use CSS3 PIE border: 1px solid #696; padding: 60px 0;
In WYSIWYG editor, I have <TABLE style=WIDTH: 162pt; BORDER-COLLAPSE: collapse border=0 cellSpacing=0 cellPadding=0 width=216>
The following HTML fails to create a centred table in FireFox, even though it
#foo {width: 300px; height: 400px; overflow: hidden;} <div id=foo></div> this.someimage = randomImageUrl; $(foo).innerHTML =
I have a fixed width DIV containing a table with many columns, and need
Is the CSS 'width' property applicable to a <textarea> ? In practice, people say
my CSS code .child{ width:100px; height:100px; display:inline-block; } my HTML code <div id=parent> <div
I don't even know if I'm doing this correctly, but I thought I'd ask
I have successfully put highlighting in my table but the problem is with alternating

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.