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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:05:21+00:00 2026-05-28T07:05:21+00:00

I have created a table and now i wanted to change the width of

  • 0

I have created a table and now i wanted to change the width of td’s depending on the text. but it is not effecting on td’s. and If i change the width of first td then it also automatically change the width of next tr “td”. How can i give different widths on different td’s in html.Below is my code.

<div style="width:100%;">
    <table border="1">
        <tr>
            <td style="font-weight:bolder;" width="150px"><span id="lblStockName"></span></td>
        </tr>
        <tr>
            <td style="font-weight:bolder;" width="30px">Bid:</td>
            <td><span id="lblBid"></td>
            <td></td>
            <td style="font-weight:bolder;">Ask:</td>
            <td><span id="lblAsk"></td>
            <td></td>
            <td style="font-weight:bolder;">Spot:</td>
            <td><span id="lblSpot"></td>
            <td></td>
            <td style="font-weight:bolder;">Hi:</td>
            <td><span id="lblHi"></td>
        </tr>
        <tr>
            <td><span id="lblLimit"></td>
            <td></td>
            <td style="font-weight:bolder;">Last:</td>
            <td><span id="lblLast"></td>
            <td></td>
            <td style="font-weight:bolder;">Ch:</td>
            <td><span id="lblCh"></td>
            <td></td>
            <td style="font-weight:bolder;">Vol:</td>
            <td><span id="lblVol"></td>
            <td></td>
            <td style="font-weight:bolder;">Low:</td>
            <td><span id="lblLow"></td>'
        </tr>
    </table>
</div>
  • 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-28T07:05:22+00:00Added an answer on May 28, 2026 at 7:05 am

    Please note, width="150px" is invalid, try width="150" or style="width: 150px" instead.

    If i change the width of first td then it also automatically change the width of next tr “td”

    This is by design; to get different widths for each <tr>‘s set of <td>‘s, you’ll have to nest tables.


    Edit

    If you’re going to stay with your current layout, you should use colspan so that <td>‘s are balanced:

    <div style="width:100%;">
        <table border="1">
            <tr>
                <td style="font-weight:bolder; width: 150px" colspan="13"><span id="lblStockName"></span></td>
            </tr>
            <tr>
                <td style="font-weight:bolder; width: 30px">Bid:</td>
                <td><span id="lblBid"></td>
                <td>&nbsp;</td>
                <td style="font-weight:bolder;">Ask:</td>
                <td><span id="lblAsk"></td>
                <td>&nbsp;</td>
                <td style="font-weight:bolder;">Spot:</td>
                <td><span id="lblSpot"></td>
                <td>&nbsp;</td>
                <td style="font-weight:bolder;">Hi:</td>
                <td colspan="3"><span id="lblHi"></td>
            </tr>
            <tr>
                <td><span id="lblLimit"></td>
                <td>&nbsp;</td>
                <td style="font-weight:bolder;">Last:</td>
                <td><span id="lblLast"></td>
                <td>&nbsp;</td>
                <td style="font-weight:bolder;">Ch:</td>
                <td><span id="lblCh"></td>
                <td>&nbsp;</td>
                <td style="font-weight:bolder;">Vol:</td>
                <td><span id="lblVol"></td>
                <td>&nbsp;</td>
                <td style="font-weight:bolder;">Low:</td>
                <td><span id="lblLow"></td>
            </tr>
        </table>
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a table in my application, I want to select (change background
I have Created a table like CREATE TABLE [dbo].[tab1]( [Id] [int] NOT NULL, [Name]
I have created a Python module that creates and populates several SQLite tables. Now,
I have created one table using the below command: create table Table1( Id int
We have created a table with a trigger that updates a ModifiedDate field in
I have created a table on an Oracle 10g database with this structure :
I have created a table in postgreSQL. I want to look at the SQL
I have created a table in my Ruby on Rails application that I am
I have created a table with the following structure- $sql = CREATE TABLE followers
I am new to iPhone development. I have created a table view in a

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.