Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Text align

Posted on 2016-09-21
6
Medium Priority
?
35 Views
Last Modified: 2016-10-10
hi experts,
i have a situation where i have to display data from database to my system. The problem is each of sentence will have a point icon and the second line of the sentence is place under the point icon. i want the second line of the sentence placed under the first word of the first line.
I have attached image for the situation below
Here is my code:

<table>
<tr>
<td valign="top"></td>
<td valign="top"><br><font face="arial" size="2">&nbsp;&nbsp;<img src="diari/oren.png" width=10>&nbsp;<b><%=rs_event("masa_mula")%> - <%=rs_event("tajuk")%></b><b><font face="Verdana" size="1" color="#008000"><%=rs_event("tempat")%></font></b></font></td>
</tr>
</table>

I hope you can help me on this. Thank you.
Capture.PNG
0
Comment
Question by:Nur
5 Comments
 
LVL 17

Expert Comment

by:bigeven2002
ID: 41810054
Hello,

Thanks for the screenshot.  So referring to that, are you wanting "D37" to appear directly below "Mesyuarat" or "9:30 AM"?

Based on your HTML, both 9:30 AM and Mesyurat... are in the sam table cell.
0
 
LVL 7

Assisted Solution

by:D Patel
D Patel earned 300 total points (awarded by participants)
ID: 41810061
list-style-position is the property you are looking for. It works in all browsers. (see MDN for more details)

ul {
   list-style-position: outside;
   /* You may want to add an additional padding-left: */
   padding-left: 1.5em;
}
0
 

Author Comment

by:Nur
ID: 41810151
bigeven2002, below 9.30 AM
0
 
LVL 3

Assisted Solution

by:pradeep kumar
pradeep kumar earned 300 total points (awarded by participants)
ID: 41810184
You can just add id on table and add this properties:

<table id="alingtext">  --- add id to table
#alingtext img{margin-left: -20px;} == add css

Open in new window

0
 
LVL 60

Accepted Solution

by:
Julian Hansen earned 1400 total points (awarded by participants)
ID: 41810198
Some notes on your markup

1. Tables for layout is not considered good practice and in this case they are limiting you.
2. The <font> tag has been deprecated - you should be using CSS to style your elements.

You probably want to be using <li> for this as it handles automatic indenting of your content when the line wraps.

Take a look at the code below for a comparison between your code and using <li> and CSS
<!doctype html>
<html>
<head>
<style type="text/css">
ul.event-list {
  list-style: none;
  margin: 0 0 0 15px;;
  padding: 0;
}
ul.event-list li {
  background: url(images/oren.png) no-repeat left top;
  font-family: Arial;
  font-size: 13px;
  font-weight: bold;
  padding-left: 15px;
}
ul.event-list li span {
  font-family: Verdana;
  font-size: 10px;
  color: #008000;
}
</style>
</head>
<body>
<table>
  <tr>
    <td valign="top"></td>
      <td valign="top"><br/>
        <font face="arial" size="2">&nbsp;&nbsp;<img src="images/oren.png" width=10>&nbsp;<b>9:30 AM - Mesyuarat Jawantankuasa Sidang Pengarang Sains ke-40 - Telesidang</b>
        <b><font face="Verdana" size="1" color="#008000">bilik mesyuarat D37</font></b></font>
      </td>
  </tr>
</table>
<ul class="event-list">
  <li>9:30 AM - Mesyuarat Jawantankuasa Sidang Pengarang Sains ke-40 - Telesidang <span>bilik mesyuarat D37</span></li>
</ul>
</body>
</html>

Open in new window

Working sample here
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question