Forum Moderators: not2easy
As a veteran wysiwyg user, I'm often baffled by the seeming black art of coding. Currently, I've got a two column table with a couple rows spanned. I'm trying to get text to fill one of the spanned rows, but it seems that there's always 50-60 pixels of empty space on one side. Here's the html and css: (problem line in red)
.descriptionText { font-size: 10pt; text-align: right }
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="text15Grey">
<tr>
<td><?=$profile["name"]?></td>
<td class="text16Red"><?=$profile["rating"]?></td>
</tr>
<tr>
<td>Self Rating</td>
<td class="text16Red"><?=$profile["self_rating"]?></td>
</tr>
<tr>
<td>Votes</td>
<td class="text16Red"><?=$profile["votes"]?></td>
</tr>
<tr>
<td>Views</td>
<td class="text16Red"><?=$profile["views"]?></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
[red]<td colspan="2" class="descriptionText" align="right" bgcolor="#f5f5f5"><?=$profile["description"]?></td>[/red]
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2" align="center">
<a href="#" onClick="window.open('send_mail.php', 'tinyWindow', 'toolbar=no,width=650,height=650');">yaddayadda</a>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<a href="#" onClick="window.open('send_mail.php', 'tinyWindow', 'toolbar=no,width=650,height=650');">yaddayadda</a>
</td>
</tr>
</table>
I'd appreciate any tips that would help me get the text to fill the box as opposed to "breaking" prematurely. Let me know if you need any more information.
[edited by: SuzyUK at 9:19 pm (utc) on Feb. 2, 2007]
[edit reason] no personal details pls.. [/edit]
Also your missing the ; off the css style.
You don't strictly need the ';' after the last style property in a style declaration (before the closing '}') - although it is good practise to stick it in to avoid problems later, when you add more style properties.
It may sound simple, but... you could try debugging with
<table border="1"...to make sure the space isn't in an adjoining table cell. Hhhhmmm... although you should have any adjoining table cells in your case!
Thanks for your help!
AHA! What the heck is this:
$profile["description"]= wordwrap($profile["description"], 30, "<br>", 1);
Looks suspicious...
Ok, it brakes after 30 characters-easy enough to change-but is anyone aware of a solution that would justify the text, so one edge isn't ragged?
$profile["description"]= wordwrap($profile["description"], 30, "<br>", 1);
This is certainly your problem, but it also ensures against very long lines without spaces (ie. a natural break) that would stretch your table-cell sideways.
An alternative, to avoid a jagged edge on both sides, might be to define in your CSS:
.descriptionText { font-size: 10pt; text-align: justify; } But this does rely in there being spaces in your text for it to be able to wrap. (Also, I'm not sure of browser support for the 'justify' value - I never use, but it may be OK?)