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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:15:59+00:00 2026-06-15T21:15:59+00:00

I have a a td with an inline style setting its width as a

  • 0

I have a a td with an inline style setting its width as a percentage. I can modify the css but not the html.

How can I make the td only take up the width required by its contents?

The following CSS doesn’t work:

td#my 
{
    width: auto !important;
}
  • 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-06-15T21:16:00+00:00Added an answer on June 15, 2026 at 9:16 pm

    Table cells are auto width by default, they however take up the minimum width of the widest cell in their column. So take this for example

    td1|td2|td3|
    
    1  |2  |3  |
    

    Those cells will all be the same width based on the first row. There is no way I can think of to force it to do this:

    td1|td2|td3|
    
    1|2|3|
    

    Which is what it sounds like you’re trying to do, not without changing the HTML anyway.

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

Sidebar

Related Questions

I have the following HTML and CSS: <style> .field { display: inline-block; width: 100px;
I have an inline style added to the HTML, like style=left: 10px; . Can
I have a fairly simple cell in a table with an inline style: <td
I have a class that had an inline member, but I later decided that
I'm working on a little html/css framework that I can use for most of
I have a style assigned for a specific HTML element in my stylesheet file,
I have a bug where a certain div is having its style.height property being
I have tried moving the position:relative; setting around, but to my understanding it is
I have to make a password meter from scratch basically (can't use outside frameworks
I have this div that's got a style attribute..In that I am setting it's

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.