Custom Template Date Field Wrap

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
michaelmcewen
User
Posts: 78

Custom Template Date Field Wrap

Post by michaelmcewen »

This is a section of my custom template:
<table border=1 width="80%">
<tr>
<td><b>Date of Exam</b>{{{value form_date}}}</td>
</tr>
<tr>
<td width=80%><b>Name</b>{{{value name}}}</td>
<td width=20%><b>Date of Birth</b>{{{value dob}}}</td>
</tr>
</table>

The date fields {{{value form_date}}} and {{{value dob}}} wrap in their cell. So it looks like:

Date of Exam
<box with date in it and date picker>

So they are on two separate rows and I want them in line on the same row:

Date of Exam <box with date in it and date picker>

How do I get it to stop wrapping and stay inline?


kirondedshem
User
Posts: 642

Post by kirondedshem »

For exampleYou used <td><b>Date of Exam</b>{{{value form_date}}}</td>

In html, the tag <b> or </b> is used to put a line break(similar to you pressing enter when typing), so obviously it will put everything after it on the second line.

SO remove the line break html tags to look like below and try again:
<table border=1 width="80%">
<tr>
<td>Date of Exam {{{value form_date}}}</td>
</tr>
<tr>
<td width=80%>Name{{{value name}}}</td>
<td width=20%>Date of Birth{{{value dob}}}</td>
</tr>
</table>

HINT:You better read about html and css, most importantly bootstrap so you can learn how to build your custom templates and still be mobile responsive, for example you should avoid using table and use divs as much as possible unless its really required. Try downloading Admin LTE template or just look at online boostrap examples and see how they draw thier forms using divs to still get a tabular layout yet still be mobile responsive


sangnandar
User
Posts: 980

Post by sangnandar »

Try this:
<td>Date of Exam <span style="display:inline-block;vertical-align:middle;">{{{value form_date}}}</span></td>

viewtopic.php?f=4&t=40781&hilit=+date&sid=af6bb756d5d1c08c20bd377c11879491

The necessary part is "display:inline-block;" while "vertical-align:middle;" is used if you put it in the middle of paragraph.


kirondedshem
User
Posts: 642

Post by kirondedshem »

Sorry guys, Ive just noticed that I misread the bold tag for a line break tag, My bad.


michaelmcewen
User
Posts: 78

Post by michaelmcewen »

I'm going to give that a whirl. Thanks for everyone's input!


Post Reply