• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

HTML Table Column Widths

 
Ranch Hand
Posts: 2153
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to get column widths in my table to display at preset widths however when the page displays the settings are ignored.
 
Sheriff
Posts: 67663
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Steve Dyke
Ranch Hand
Posts: 2153
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I use <TD width="60"> in my HTML code(using JSTL to build table dynamically) and when the page displays the column is small(maybe 25).
 
Bear Bibeault
Sheriff
Posts: 67663
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What are you thinking that 60 means?
 
Steve Dyke
Ranch Hand
Posts: 2153
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:What are you thinking that 60 means?



I don't really know for sure what unit it is. What I do know is that I have two div tags, each have a table in them, the first column of each is set to 60 and they do not line up as I had hoped they would.
 
Bear Bibeault
Sheriff
Posts: 67663
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
width is in pixels, and is deprecated.

Why are you not using CSS?
 
Steve Dyke
Ranch Hand
Posts: 2153
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:width is in pixels, and is deprecated.

Why are you not using CSS?



I don't have an excuse other than I have not taken(had) time to learn the css method of programing(if you can call what I do programing).

I do have a css that controls my table layout but not the specific column widths. If I change the <TD> or <TH> tags in the css won't it affect all of the tags used on the page. How do I control only one column with the css?
 
Bear Bibeault
Sheriff
Posts: 67663
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Depends upon the modern-inity of browsers you are supporting. If the browsers support nth-child, you're golden. Otherwise, you could give the columns class names to use as CSS hooks.

P.S. Not to sound mean or anything, but it's 2009. Wrap your head around CSS, and do it now.
 
Steve Dyke
Ranch Hand
Posts: 2153
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Depends upon the modern-inity of browsers you are supporting. If the browsers support nth-child, you're golden. Otherwise, you could give the columns class names to use as CSS hooks.

P.S. Not to sound mean or anything, but it's 2009. Wrap your head around CSS, and do it now.



Not to be hardheaded or anything but just for a test I put style="width:60px" in the TD tag of my HTML page code and still get the same results. If I set up the css won't it have the same line of code.

Can you give me direction on the class name and CSS hook method?

All of our users are on IE7.
 
Bear Bibeault
Sheriff
Posts: 67663
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Too many men are afraid of being fools - Henry Ford. Foolish tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic