English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

please can you help. i,m building my frames and adding widths, to the program, but if i add more no 1s into the cells, they expand,,, i thought that adding a width attribute it would not allow the cell to expand, but may increase the height if to much text was added. i would like to add that i am very new to html, and that i,m teaching myself from reading, i would be most grateful if you could read the the small program below, and advise me " were i,m going wrong,

thank you for you help

G morris



tables














cell 1 cell 1
cell 3 cell 4


2006-08-29 09:33:11 · 8 answers · asked by glenmrrs 2 in Computers & Internet Programming & Design

8 answers

Take a look at this simple example:











Add all the text you want and it will scroll to the next line. Add all the text you want and it will scroll to the next line.
Add all the text you want and it will scroll to the next line. Add all the text you want and it will scroll to the next line.


Of course you can make the table any size you want, and you can use percentages if you prefer. Try a few things to see if it's what you want. But this is basically all you would need to make the lines of text.

2006-08-29 09:53:17 · answer #1 · answered by DianeD 4 · 0 1

Because you put colspan="2" in the first , the next row should have 3 td elements (or the first row should have only 1). As it is, you can expect sizing problems.

You may be able to use the CSS 'clip' property, but it requires you know width and height in advance.

Another possible is the CSS 'overflow' property which suppresses scroll bars on oversize content. Again, your td would have to be sized in width and height for this to work. Perhaps like this:

too many words

2006-08-29 10:31:59 · answer #2 · answered by sheeple_rancher 5 · 0 0

Table cells will expand to fit their contents in most cases. To change this, you can add "style="overflow:hidden;" (or scroll, if you want it to pop up scroll bars) to keep it a certain width. If there are no spaces in your words (11111111111111) then html won't know where to break it and will follow the overflow directive, usually, unless set otherwise like described above, it will stretch the table cell to fit. The width=".." attribute is just a suggestion, not a rule.

2006-08-29 10:56:45 · answer #3 · answered by John J 6 · 0 0

Below an example that gives what I think you are looking for.

Notice no colspan - not sure why you had included that one (please clarify the question if I have missed something).

You can change the table and cells size to any width.

















cell 1 cell 2
This is a long text to show it stays in the cell and just wrap around cell 4

2006-08-29 10:11:09 · answer #4 · answered by menn 2 · 0 1

if the text in a cell has no spaces like ...


reallylongtext

... then the table *has* to expand regardless of any width settings and there's nothing you can do in HTML to force that text to wrap. to do this you'd have to use javascript to print out the text (with line breaks after a certain number of characters) or you could also manage this on the server side (figure our where to insert the line breaks with some server-side script and then print out the result to the HTML page.

2006-08-29 09:42:05 · answer #5 · answered by eric melkerson 2 · 1 0

Hi, without knowing what you are actually trying to achieve I am not sure what I can sya. I have also been learning HTML along with Javascript. Maybe you could email me through answers and I would have more understanding of your question.

2006-08-29 09:44:46 · answer #6 · answered by Phil J 3 · 0 1

try removing the colspan attribute form the first td tag and then try again. I do not see why you would need it there anyways.

Hope that helps.

2006-08-29 09:42:21 · answer #7 · answered by americanDesi 2 · 0 1

the width="60"is telling it so set the width to 60 pixels always. take out the width tag and see if it works - you can try your html for free on http://www.w3schools.com

2006-08-29 09:39:44 · answer #8 · answered by ever_curious 3 · 0 1

fedest.com, questions and answers