表格宽度与Smarty

How to use alternative width in table with php? I used this way but getting Error.

<table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td width="{if $label_payment}{echo = 50%}{else}{echo = 100%}{/if}">Shipping Address
        </td>
        <td>Payment Address
        </td>
    </tr>
    <tr>
        <td width="{if $label_payment}{echo = 50%}{else}{echo = 100%}{/if}">{$address_label_shipping}
        </td>

        {if $address_label_payment}
            <td width="50%">{$address_label_payment}
            </td>
        {if}

    </tr>
</table>

Is this the correct way?

{if $label_payment}{echo = 50%}{else}{echo = 100%}{/if}

There is no echo:

{if $label_payment}50%{else}100%{/if}

leading to:

<td width="{if $label_payment}50%{else}100%{/if}">

Try this...

 <td {if $label_payment}width="50%"{else}width="100%"{/if}>Shipping Address