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

x
?
Solved

Simple Question on div

Posted on 2011-09-26
5
Medium Priority
?
176 Views
Last Modified: 2012-05-12
I have a form which displays class information. So the form should look something like this :-

Name                        Information
not found                   not found

But when i use the above  code it outputs them very close to each other like this :-

Name      Information
not found not found

If the name of the person is long and the information is long then everything works fine but when the name is short and the information is short then the form looks like this :-

Name                  Information
Testiing               this is not
123                      nice and i

Can anyone tell me what do i need to do to fix it ?. I just want to look like this :-

Name                                   Information
Testing 12345                      This is great and i am ready to do something very special
                                              someday. testing....
<table>
		<tr>
			<td ><b>Name</b><br />
				<div align="left" style="width: 100%;">
					not found
				</div>
			</td>
			<td><b>Information</b><br />
				<div align="right" style="width: 100%;">
					not found
				</div>
			</td>
		</tr>
	</table>

Open in new window

0
Comment
Question by:Micheal_Male
[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
5 Comments
 
LVL 16

Expert Comment

by:Easwaran Paramasivam
ID: 36707622
Keep Title and Information in Different TD and remove div tag. See below example.

<tr>
<td width="100%">
   <b>Name</b>
</td>
<td style="align:left" width = "100%">
   Not Found
</td>
</tr>

0
 

Author Comment

by:Micheal_Male
ID: 36707666
I don't think that is correct. My title is on left side and the Not found is all the way on the right.
0
 
LVL 16

Accepted Solution

by:
Easwaran Paramasivam earned 168 total points
ID: 36707801
Use attached code like.
<html><body>
<table>
<tr>
<td width="50%">
   <b>Name</b>
</td>
<td width = "50%">
  <b>Information required</b>
</td>
</tr>
<tr>
<td style="align:left" width="50%">
    Not Found
</td>
<td style="align:left" width = "50%">
   Not Found
</td>
</tr>
</table>
</body>
</html>

Open in new window

0
 
LVL 17

Assisted Solution

by:sonawanekiran
sonawanekiran earned 164 total points
ID: 36707869
If you don't want to change your html then try this
<table width="100%">
    <tr>
      <td width="50%"><b>Name</b><br />
        <div align="left" style="width: 100%;">
          not found
        </div>
      </td>
      <td><b>Information</b><br />
        <div align="left" style="width: 100%;">
          not found
        </div>
      </td>
    </tr>
  </table>

Open in new window

0
 
LVL 5

Assisted Solution

by:eridanix
eridanix earned 168 total points
ID: 36707938
<table>
      <tr>
            <td width="200px"><b>Name</b><br />
                  <div style="float:left;">
                        not found
                  </div>
            </td>
            <td width="200px"><b>Information</b><br />
                  <div style="float:left;">
                        not found
                  </div>
            </td>
      </tr>
</table>

or if table have to be over whole page:

<table width="100%">
      <tr>
            <td width="50%"><b>Name</b><br />
                  <div style="float:left;">
                        not found
                  </div>
            </td>
            <td width="50%"><b>Information</b><br />
                  <div style="float:left;">
                        not found
                  </div>
            </td>
      </tr>
</table>
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

636 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