Solved

Text align

Posted on 2016-09-21
6
30 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 Amirah Roslan
[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 75 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 Amirah Roslan
ID: 41810151
bigeven2002, below 9.30 AM
0
 
LVL 3

Assisted Solution

by:pradeep kumar
pradeep kumar earned 75 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 56

Accepted Solution

by:
Julian Hansen earned 350 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

Suggested Solutions

Title # Comments Views Activity
Embedding Tags in a restricted UI 6 36
CSS Style on Chrome 1 40
What cart is this? 2 38
Why is my $_POST not going to results page 10 41
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
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…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
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).

730 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