Table going past width boundries

G

Geoff Robinson

Hi,

I am creating a table dynamically, and I need it to fall within a
certain width. My problem is that some data is too long and is causing
the table to go past the specified width. Is there a way to force a
cell or a row to not go beyond the width even if the data is too
large?

thanks for any help in advance,
Geoff
 
B

brucie

In alt.html Geoff Robinson said:
Hi,
g'day

I am creating a table dynamically, and I need it to fall within a
certain width.

tables and their cells expand to hold their content.
My problem is that some data is too long and is causing
the table to go past the specified width.

don't put so much in. its being dynamically generated so its would be
simple to do. but then you have things like font size issues.
Is there a way to force
no.

a cell or a row to not go beyond the width even if the data is too
large?

truncate the data while allowing a reasonable amount of flexibility to
account for different font sizes/families etc.

or use a bit of css to hide or scroll the content but that sucks.

or instead of trying to force your table to fit within the design
redesign so its not an issue.
 
A

aa

In a W3C complient browser tables comply to the WIDTH attribute.
(IE in the absence of WIDTH attribute makes a table to fit into the screen
width automatically)
The length of data is irrelevant as too long data is broken into lines and
expanded downwards.
However there is a natural exeption:
if data is a string with no spaces or an object like an image which cannot
be broken into several lines, then the cell width is expanded to accomodate
this data
This usually becomes an issue if you have too many columns so that each
column becomes too narrow even for a single word.
So you have to monitor number of columns and the longest word/object in each
column.
 
R

rf

aa wrote
In a W3C complient browser tables comply to the WIDTH attribute.
(IE in the absence of WIDTH attribute makes a table to fit into the screen
width automatically)

IE and just about every other visual browser, in the absence of a width
attribute, make the table fit the size of the content, not the browser
window width and most certainly not the width of the viewers screen.
 
A

aa

Take IE6, experiment and report the result

rf said:
aa wrote


IE and just about every other visual browser, in the absence of a width
attribute, make the table fit the size of the content, not the browser
window width and most certainly not the width of the viewers screen.
 

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,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top