• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help on defining CSS

 
Ranch Hand
Posts: 544
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,
I have a following scenario.
In a HTML we have a table which displays some data. The Table with header is displayed first and then the data to be displayed is fetched.
When we display the table and header there is a certain CSS attributes applied to header names which defines the header column size. Now when the data is fetched and rows are displayed in the HTML then the header column and the data column beneath that doesnt match.
I tried manipulating this but then it works for some scenarios and not all of them.


For e.g if Column name is "ABC" and the data displayed in the column is of 3 Chars then its fine. But if the data is more than 3 characters then the header and data column mismatch happens.

--------------
ABC | XYZ
--------------
123 | 456
--------------

Is there anyway after populating the data in the column I can resize the header columns by considering the length of the largest data in that particular column?
I feel somehow I will need to set new "width" to the header column but then how do I find out which is the data entry which has most number of characters?
regards,
amit
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can do something like this:



I wrote it here so it is untested and may have errors.

Eric
 
amit punekar
Ranch Hand
Posts: 544
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
Thank you for the response.
I will try using the suggested approach.

regards,
amit
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic