Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

HTML table uniform row size..  RSS feed

 
Steve Renard
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a question on HTML tables..
I want my table rows to be of uniform width and height.
Because when the size of the cell values vary, they ajust and it affects the uniformity.
How do I make the cell values to be of constant height and width, unmindful of the cell value size?
Any style attrbutes for this?
I tried max-height & max-width.. Couldn't get it to work..
Please help..
 
Steve Renard
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One more I missed.
I also don't mind if the text in cells are partly cut off..
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might try setting a fixed size and use overflow: hidden.
 
Steve Renard
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Should I use in the <tr> tag or <td> tag for each cell?
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Steve,

Please look at http://www.w3.org/TR/CSS21/tables.html#fixed-table-layout


 
Steve Renard
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
The width portion of the problem is taken care of now..
But I have the row height auto adjusted for a large cell value..
So I still don't get the overall uniformity across the table.
Suggestions please..
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It says at http://justaddwater.dk/2006/03/11/how-to-limit-table-cell-height-gmail-style/ that the following works -



A similar post to yours at http://www.stylusstudio.com/xsllist/200403/post10320.html#
 
Steve Renard
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cool...
That worked..
Thanks a lot!!!
 
Steve Renard
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oops!!!
The table-layout: fixed; attribute allocates the table width equally to all the columns.
But I have some columns which are wider than the others.
Here there are unwanted spaces for a short cell text and clipped part for a wide cell text.
So the non-uniformity problem is back again on the width part.
Please help..
 
Steve Renard
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In other words, I want to allocate cell width individually for each cell.
Looking forward to your help..
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Steve,

Please use the width attribute for individual cells as you see in my post from July 26.

Cheers,
Dan
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!