Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Text align

Posted on 2016-09-21
6
Medium Priority
?
33 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 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 59

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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
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?
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

618 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