GeeCON Prague 2014*
The moose likes HTML, CSS and JavaScript and the fly likes set a universal size for the cells in a table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "set a universal size for the cells in a table" Watch "set a universal size for the cells in a table" New topic
Author

set a universal size for the cells in a table

Brendan Kennedy
Ranch Hand

Joined: May 02, 2001
Posts: 65
Does anyone know how to do this??
td {width: 200px}
in my style sheet doesn't work..
I also tried for just one cell <td width=200> but this didn't do anything!
everyone on the web seem to think that that's the solution but it's not.
It would be better if I can set the size in the <table> tag or the <td> tag cos I dynamically draw the table headers separately in a div and I
can't have the css being applied to them each time they're drawn.
It is ok if the cells are large because I hope to make them all the same size as the largest cell(the size of which is known)
Any ideas?
Thanks,
Brendan
James Lee
Ranch Hand

Joined: Oct 16, 2006
Posts: 36
I have the same issue. Does anyone have a solution/get-around?

Thanks.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6


That works for me, not sure what is the problem.

Eric
James Lee
Ranch Hand

Joined: Oct 16, 2006
Posts: 36
Thanks, Eric.

The issue is when the length of a cell content is more than 200 px in your code, that column will be changed wider. In other words, is there a way to make cell contents get wrapped automatically if they are two long so that the column's width stays fixed instead of getting bigger?

Thanks.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You can look into the css word-wrap

Eric
 
GeeCON Prague 2014
 
subject: set a universal size for the cells in a table