Table cell width fixed size

F

Fabian Vilers

Hello all,

I need to draw a table with fixed size (height + width) cells. In any
case, the text should never expand the size of the cell.

Any help is appreciated,
Fabian
 
R

Roy Schestowitz

__/ [ Fabian Vilers ] on Monday 24 April 2006 09:49 \__
Hello all,

I need to draw a table with fixed size (height + width) cells. In any
case, the text should never expand the size of the cell.

Any help is appreciated,
Fabian

<table width=VALUEH style="height: VALUEVpx;">

This table will have a fixed width VALUEH and a minimal height of VALUEV. It
would not makes sense for the height to be strictly forced, however. This
would lead to text disappearing and, mind you, tables cannot have scroll
bars. This is adverse to user's desire and will (just about any stalwart
advocate of standards would argue this). For this, you might wish to have a
look into iframes, which are scrollable and have fixed dimensions.

Hope it helps,

Roy
 
F

frederick

Fabian said:
I need to draw a table with fixed size (height + width) cells. In any
case, the text should never expand the size of the cell.

Why on Earth not? What if the text's too big to fit in the defined
cell size? What if the user makes use of a different size of text than
you do?
 
J

Jukka K. Korpela

Fabian said:
I need to draw a table with fixed size (height + width) cells. In any
case, the text should never expand the size of the cell.

Reanalyze the original problem, and you'll probably notice that you
don't need to create such problems.

If you insist on creating a problem with fixed-size cells, set the
height and width of each cell in CSS _and_ set
table-layout: fixed
for the table. Additionally, set the overflow property for the cells;
the value depends on whether you wish to have content hidden or let it
overflow outside the cell or have scroll bars in a cell.
 
F

Fabian Vilers

Jukka said:
Fabian Vilers wrote:

All of the proposals you made was not correct.

First I must say the business design of the applications I need to work
on is really poor. Specifications are these, I must wrap the cell content.

I finally manage to find the solution by myself.

The content of the cell is enclosed inside a <div style="height: 123px;
width: 456px; overflow: hidden">

Anyway; thanks for your responses.
Fabian
 
P

Paul Watt

Fabian Vilers said:
All of the proposals you made was not correct.

First I must say the business design of the applications I need to work on
is really poor. Specifications are these, I must wrap the cell content.

I finally manage to find the solution by myself.

The content of the cell is enclosed inside a <div style="height: 123px;
width: 456px; overflow: hidden">
If you re-read Jukka's post he said to do that
 
J

Jukka K. Korpela

Paul said:
If you re-read Jukka's post he said to do that

Well, something in that direction, in the "If you insist on creating a
problem" part, but I surely did not suggest creating additional problems
by using px dimensions, and I did not suggest using an artificial <div>
element, or using inline styles.

If the business design of an application is really poor, it should be
redesigned. We have no way of knowing whether the OP even tried asking
whether the original problem could be fixed. (He mentioned that he "must
wrap the cell content", which is something completely different and
might indicate that the business design has been misunderstood.)
 
A

Alan J. Flavell

I need to draw a table with fixed size (height + width) cells. In any case,
the text should never expand the size of the cell.

In case it wasn't already obvious, HTML has no way to work around a
fundamentally misconceived requirement.
Any help is appreciated,

To get a usable result, first redefine the user requirement. No real
user would really demand that the required text should fail to fit in
its cell - and that's what you just asked for. Ergo, whoever
specified this requirement is not representative of a user. The next
step is yours, I guess.
 
N

Neredbojias

To further the education of mankind, Fabian Vilers
All of the proposals you made was not correct.

First I must say the business design of the applications I need to
work on is really poor. Specifications are these, I must wrap the cell
content.

I finally manage to find the solution by myself.

The content of the cell is enclosed inside a <div style="height:
123px; width: 456px; overflow: hidden">

You must wrap the cell content and hide the overflow? -With all users'
varying text-sizes, etc., to deal with? Okay...
 
F

Fabian Vilers

Neredbojias said:
You must wrap the cell content and hide the overflow? -With all users'
varying text-sizes, etc., to deal with? Okay...

I know this sucks
 
Joined
Aug 21, 2007
Messages
1
Reaction score
0
Jukka K. Korpela said:
Fabian Vilers wrote:

> I need to draw a table with fixed size (height + width) cells. In any
> case, the text should never expand the size of the cell.


Reanalyze the original problem, and you'll probably notice that you
don't need to create such problems.

If you insist on creating a problem with fixed-size cells, set the
height and width of each cell in CSS _and_ set
table-layout: fixed
for the table. Additionally, set the overflow property for the cells;
the value depends on whether you wish to have content hidden or let it
overflow outside the cell or have scroll bars in a cell.

Either Jukka is extremely new to the game, or plain incompetent. Anyone with a bit of real life experience knows that just because a standard is set out to handle most scenarios, there will ALWAYS be real life cases where it's not sufficient. Coming up with a scenario where you have an independent system where a html based interface needs to trunkate text in table cells is not a hard task for anyones imagination.

Just the fact that he suggests to "redesign the business design" is proof that he probably hasn't worked very much in larger real world web applications: The person who deals with HTML tables is often very far away from the person who develops business logic.
 
Joined
Mar 11, 2009
Messages
1
Reaction score
0
stochmind said:
Either Jukka is extremely new to the game, or plain incompetent. Anyone with a bit of real life experience knows that just because a standard is set out to handle most scenarios, there will ALWAYS be real life cases where it's not sufficient. Coming up with a scenario where you have an independent system where a html based interface needs to trunkate text in table cells is not a hard task for anyones imagination.

Just the fact that he suggests to "redesign the business design" is proof that he probably hasn't worked very much in larger real world web applications: The person who deals with HTML tables is often very far away from the person who develops business logic.

Here here! I'm also looking for a solution to this same problem. A little tip for those of you who feel the need to say things like "why do you want to do that!?" - that's not particularly helpful and I'm sure the author has his reasons for wanting to do what he wants to do.

Why do I want to do it? Quite frankly, none of your damn business. If you don't know the answer then you might consider not responding rather than proving what a complete, self-righteous, holier-than-thou a-hole you are.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top