This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > Dreamweaver > December 2005 > How do I stop a cell from extending across the page
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
How do I stop a cell from extending across the page
|
|
| Agent_JC 2005-12-29, 10:24 pm |
| Hello and thankyou in advance:
I'm about to tear my hair out.
I have set up a dynamic table which includes a cell that holds a lot of text
(personal profile) from my database of employees. The problem I have is the
text doesn't flow from line to line, it just stretches accross into the future.
I have fixed all my table width sizes on the page.
I guess I just want to know how to make text flow from line to line and not
expand a table or it's cell.
Kind regards,
Josh.
| |
| John Waller 2005-12-29, 10:24 pm |
| > I guess I just want to know how to make text flow from line to line and
> not
> expand a table or it's cell.
You can't. It's how HTML tables work. They adjust to accommodate the
contents within them taking into account the requirements of adjoining
cells. If adjoining cells are empty, they shrink or collapse to allow other
adjoining cells containing the most data to occupy the most screen real
estate.
Many people treat HTML tables as spreadsheet cells, which they're not. This
creates the frustration.
You can judiciously insert spacer images (tiny transparent GIF images) in
adjoining cells to stop them collapsing and force word wrap in adjacent
cells. Spacers (or shims) set a minimum cell width. It's an old, outdated
technique. It's deprecated. It's frowned upon by web veterans. But it can
still be helpful in certain circumstances.
An alternative is a hybrid of HTML tables with CSS. Example here:
http://www.projectseven.com/tutoria...ss_td/index.htm
All depends on how your page is laid out and what kind of data you're
reading from the database.
Can you provide a URL?
--
Regards
John Waller
| |
| Joe Makowiec 2005-12-29, 10:24 pm |
| On 29 Dec 2005 in macromedia.dreamweaver, Agent_JC wrote:
> I have set up a dynamic table which includes a cell that holds a lot
> of text (personal profile) from my database of employees. The
> problem I have is the text doesn't flow from line to line, it just
> stretches accross into the future. I have fixed all my table width
> sizes on the page.
>
> I guess I just want to know how to make text flow from line to line
> and not expand a table or it's cell.
It's in the nature of HTML elements to expand until they run into
something. So if you have a simple table structure like this:
<table>
<tr>
<td>Lorem ipsum dolor sit amet...</td>
</tr>
</table>
the td (and thus the <tr> and the <table> ) will expand with the amount
of contents until it hits something, presumably the right side of the
browser viewport. It's only at that point that the text will start to
wrap.
If there is something constraining the table's width, then the text
will wrap when it hits that. You have a few options:
- HTML attribute:
<table width="450" ...>
- CSS:
<table style="width:450px;" ...>
Either of these can be applied to <table>, <tr> or <td>, although
applying them to <tr> can be flaky. The CSS also is preferably applied
through a class or identifier rather than through an inline style as it
is in the example.
- Containing structure:
<style type="text/css">
#container {
width : 450px ;
}
</style>
....
<div id="container">
<table ...>
If you give us the URI to your page, somebody will be able to help
advise you the best way to go about it for your page.
--
Joe Makowiec
http://makowiec.net/
Email: http://makowiec.net/email.php
| |
| Agent_JC 2005-12-31, 3:17 am |
| John:
Thanks for your reply. Have fixed the problem.
Happy new year,
Josh.
| |
| Agent_JC 2005-12-31, 3:17 am |
| Joe:
Thanks for your reply. Have fixed the problem.
Happy new year,
Josh.
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|