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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:37:27+00:00 2026-06-09T19:37:27+00:00

I have a HTML table as shown in http://jsfiddle.net/Lijo/JN8Pm/1/ . This table is generated

  • 0

I have a HTML table as shown in http://jsfiddle.net/Lijo/JN8Pm/1/ . This table is generated by gridview in asp.net. Hence I cannot add a class to “td” inside “tr”. [This is the suggestion in many forums; but that won’t work for me due to gridview]

How can I

  1. set the background color of Emp ID column as Red?
  2. set the width of Emp ID column as 300px?

Reference:

Refer the following two for table styling

1. table-layout:fixed;
2. word-wrap:break-word;
  1. Using "word-wrap: break-word" within a table
  2. Word-wrap in an HTML table
  3. Adjusting HTML Table Cell Width using jQuery
  4. Table cells get hidden when total width is more than 100%
  • 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-09T19:37:29+00:00Added an answer on June 9, 2026 at 7:37 pm

    You can see live example here: http://jsfiddle.net/JN8Pm/8/

    var table = $('#detailContentPlaceholder_grdTransactions'),
        trs = table.find('tr'),
        headTr = table.find('.second'),
        empHeader = $($(headTr).children('th')[1]);
    
    table.width(table.width() + 300);
    
    empHeader.css('background-color', 'red');
    empHeader.width(300);
    
    for (var i = 2; i < trs.length; i += 1) {    
        var td = $($(trs[i]).children('td')[1]);
        td.css('background-color', 'red');
        td.width(10);
    }​
    

    It’s changing the color and the size of the EmplID column.
    I hope that this is solving your problem.

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

Sidebar

Related Questions

http://jsfiddle.net/Cyjye/ I m new to jquery. I have made html table shown in jsfiddle.Firstly
I need to set the table cell width as 300 as shown in http://jsfiddle.net/Lijo/Q3pa2/3/
I have checkboxes as shown in http://jsfiddle.net/Lijo/Fw3fz/ . I need to align the checkboxes
I have an HTML table in my jsp page. This conains text fields and
I have a html table like this: Invoice# Due Date Balance Select 12345 12/25/2011
I have this html table: <table class=table-all> <tbody> <tr> <td>BISFENOLO</td> <td>Bisfenolo-AF 10/10</td> <td class=right>€
I have an HTML table of tickets listings (e.g. http://seatgeek.com/event/show/23634/buffalo-bills-vs-tennessee-titans/ ). I'd like to
In my HTML I have this table setup which is composed of separated images
I have a HTML Table which is similar to the one shown (demo.jpg) in
I have an HTML table element called results. This table is dynamically populated with

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.