12
I'm using PHP, Smarty and TCPDF library to generate the PDF copy of a document. The document contains images of mathematical expressions from WIRIS editor along with the text content.
I'm having a problem positioning the text coming next to the expression image properly.
I tried every thing in CSS float properties, but nothing happened. I'm attaching the screen shot of exactly what I want with this mail.
This is the smarty template code to print the question and its options:
{foreach from=$question_data item=qstn_ans key=key}
<table border="0" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td valign="top" >{if $qstn_ans.question_directions}{$qstn_ans.question_directions}<br /><b>Question {$que_seq_no} : </b>{/if}{$qstn_ans.question_text}</td>
</tr>
{if $qstn_ans.question_file}
<tr>
<td><img src="{$ques_thum_image_path}{$qstn_ans.question_id}_{$qstn_ans.question_file}" /></td>
</tr>
{/if}
{if $qstn_ans.question_has_sub_ques==0}
{if $qstn_ans.answer}
{foreach from=$qstn_ans.answer item=ans key=ans_no}
<td valign="top" >
{if $ans.answer_is_right==1}{assign var='correct_ans' value=$ans_no+1}{/if}
<b>{$ans_no+1}.</b> {if $ans.answer_text!=''}{$ans.answer_text}{/if}
{if $ans.answer_file!=''}<img src="{$ans_thumb_img_path}{$ans.answer_id}_{$ans.answer_file}" />{/if}
</td>
</tr>
{/foreach}
<tr>
<td></td>
</tr>
</table>
{/foreach}
This code snippet may contain some errors, as I pasted it randomly without checking the loop and brackets completio