aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes HTML table uniform row size.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "HTML table uniform row size.." Watch "HTML table uniform row size.." New topic
Author

HTML table uniform row size..

Steve Renard
Ranch Hand

Joined: Apr 27, 2007
Posts: 66
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

Joined: Apr 27, 2007
Posts: 66
One more I missed.
I also don't mind if the text in cells are partly cut off..
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60050
    
  65

You might try setting a fixed size and use overflow: hidden.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Steve Renard
Ranch Hand

Joined: Apr 27, 2007
Posts: 66
Should I use in the <tr> tag or <td> tag for each cell?
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1164
Steve,

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




William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
Steve Renard
Ranch Hand

Joined: Apr 27, 2007
Posts: 66
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

Joined: Jul 09, 2001
Posts: 1164
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

Joined: Apr 27, 2007
Posts: 66
Cool...
That worked..
Thanks a lot!!!
Steve Renard
Ranch Hand

Joined: Apr 27, 2007
Posts: 66
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

Joined: Apr 27, 2007
Posts: 66
In other words, I want to allocate cell width individually for each cell.
Looking forward to your help..
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1164
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.
 
subject: HTML table uniform row size..
 
Similar Threads
jsp insert program not working
Constant table cell height and width?
JTable Cell with Multi line
Scroll of div fail to work when table row inside it is higlighted
How to control the width and height for a submit button with ie?