how to restrict the width of long text passages within a table
Posted by
nnako on
Apr 19, 2014; 9:05pm
URL: https://support.nabble.com/how-to-restrict-the-width-of-long-text-passages-within-a-table-tp7590082.html
Hi,
I'm trying to modify my forum appearance. For this, I have changed to "mixed application" and now I would like to add text paragraphs holding the sub forum "description text" below the sub forum titles (they are all pinned) within the main view of the forum. So, I intend to modify two macros:
topics_column- add another parameter "description" in the macro header which carries the description text of the sub forum
- add some code to put the text in the right position below the sub forum title
<override_macro name="topics_column" parameters="width,title,count,description">
<n.table_column>
<head>
<td class="[n.column_default_border/] topics-column nowrap" style="[n.width_style.width/]">
<table class="avatar-table">
<tr>
<td class="nowrap" style="font-weight:bold;border:none">
<n.default. to="[t]Topics[/t]"><n.title/></n.default.>
<span class="weak-color" style="font-size:80%;margin-right:1.7em">(<n.count/>)</span>
<n.if.not.is_null.description>
<then>
<br/>
<span class="weak-color" style="font-size:60%;margin-right:1.7em">
<n.description/>
<br/>
HERE COMES THE DESCRIPTION TEXT FOR THE SUB FORUM HERE COMES THE DESCRIPTION TEXT FOR THE SUB FORUM HERE COMES THE DESCRIPTION TEXT FOR THE SUB FORUM HERE COMES THE DESCRIPTION TEXT FOR THE SUB FORUM HERE COMES THE DESCRIPTION TEXT FOR THE SUB FORUM HERE COMES THE DESCRIPTION TEXT FOR THE SUB FORUM
</span>
</then>
</n.if.not.is_null.description>
</td>
</tr>
</table>
</td>
</head>
<body>
<n.current_node.>
<td class="[n.column_default_border/]">
<table>
<tr>
<n.topics_column_start/>
<td class="adbayes-content" style="width:100%;padding-left:.3em;border:none;word-break:break-word">
<n.if.is_app>
<then>
<b><n.node_link/></b>
<span class="weak-color">
(<n.remove_spaces_between_tags.>
<n.one_or_many.topic_count>
<one_text><t>topic</t></one_text>
<many_text><t>topics</t></many_text>
</n.one_or_many.topic_count>
</n.remove_spaces_between_tags.>)
</span>
</then>
<else>
<n.smart_post_link/>
<span class="weak-color">
<t>by <t.author.owner.name truncate="20"/></t>
</span>
</else>
</n.if.is_app>
</td>
</tr>
</table>
</td>
</n.current_node.>
</body>
</n.table_column>
</override_macro>
and
mixed_topics_column-> add another "description"-tag filled with something like "<n.remove_html_tags.current_node.message.as_text/>"
<override_macro name="mixed_topics_column">
<n.topics_column>
<title>
<n.if.is_in_command name="top_topics">
<then><t>Topics</t></then>
<else>
<n.current_node.node_link class='second-font category-link'/>
</else>
</n.if.is_in_command>
</title>
<count>
<n.if.is_in_command name="top_topics">
<then>
<n.page_node.topic_count filter="[n.children_filter/]"/>
</then>
<else>
<n.current_node.child_count/>
</else>
</n.if.is_in_command>
</count>
<description>
<n.if.is_in_command name="top_topics">
<then>un-pinned topics</then>
<else>
<n.remove_html_tags.current_node.message.as_text/>
</else>
</n.if.is_in_command>
</description>
</n.topics_column>
</override_macro>
But when the description text for sub forums is long, no word-wrap occurs and the subsequent columns are pushed to the right side. You see it on the picture:
Is there a NAML macro to restrict the text flow to a certain width and then doing a word-wrap?Thanks.