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
|