Solved

2nd Line Same Column

Posted on 2014-01-09
17
233 Views
Last Modified: 2014-01-09
How to write the 2nd line line in the same column? Thanks

<html>
<head></head>
<body>
<table border = "1" width="800" height = "500"align = "center">
<tr>
<td><h2><strong>Objectives</strong></h2></td>
<!--This is a  2nd line after objectives in the same column-->
<td align="center"><img src="camel.png"></img></td>
</tr>
</table>
</body>
</html>
0
Comment
Question by:mustish1
[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
  • 9
  • 8
17 Comments
 

Author Comment

by:mustish1
ID: 39769891
Its not showing right under objective

<html>
<head></head>
<body>
<table border = "1" width="800" height = "500"align = "center">
<tbody>
<tr>
<td><h2><strong>Objectives</strong></h2></td>
<!--This is a  2nd line after objectives in the same column-->
<td align="center"><img src="camel.png"></img></td>
<tr><td>Test</td></tr>
</tr>
</tbody>
</table>
</body>
</html>
0
 
LVL 58

Expert Comment

by:Gary
ID: 39769893
<html>
<head></head>
<body>
<table border = "1" width="800" height = "500" align = "center">
<tbody>
<tr>
<td><h2>Objectives</h2></td>
</tr>
<tr>
<td align="center"><img src="camel.png" /></td>
</tr>
<tr><td>Test</td></tr>
</tr>
</tbody>
</table>
</body>
</html> 

Open in new window

0
 

Author Comment

by:mustish1
ID: 39769897
Thanks. But it moves the picture of camel as I need the camel on the right side and the text on the left. I have to write multiple lines on the left side.
0
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!

 
LVL 58

Expert Comment

by:Gary
ID: 39769910
Confused what you want where

<html>
<head></head>
<body>
<table border = "1" width="800" height = "500" align = "center">
<tbody>
<tr>
<td><h2>Objectives</h2></td>
<td align="center"><img src="camel.png" /></td>
</tr>
<tr><td>Test</td></tr>
</tbody>
</table>
</body>
</html>  

Open in new window

0
 

Author Comment

by:mustish1
ID: 39769922
When i run the code it shows a big gap between objectives and another text.

Objectives

                                                                      Picture


Test



But I want

Objectives
Test........                                                       Picture
Test2......
Test3......

Thanks.
0
 
LVL 58

Expert Comment

by:Gary
ID: 39769923
Well the row will be as high as the image.
If you want test, test2, test3 etc to be directly under Objectives then you need to put them in the same cell and not on another row.

You shouldn't use tables for design - tables are for tabular data not to layout a web page.
0
 

Author Comment

by:mustish1
ID: 39769931
I remove the width and height from the table now is there any way i can write the text directly under Objectives? How to use a line break inside the td ? Thanks.

<html>
<head></head>
<body>
<table border = "1" align = "center">
<tbody>
<tr>
<td><h2>Objectives</h2></td>
<td align="center"><img src="camel.png" /></td>
</tr>
<tr><td>Test</td></tr>
</tbody>
</table>
</body>
</html>
0
 
LVL 58

Expert Comment

by:Gary
ID: 39769934
There is another  way to do it
<html>
<head></head>
<body>
<table border = "1" align = "center">
<tbody>
<tr>
<td><h2>Objectives</h2></td>
<td align="center" rowspan="10"><img src="camel.png" /></td>
</tr>
<tr><td>Test</td></tr>
</tbody>
</table>
</body>
</html> 

Open in new window

0
 

Author Comment

by:mustish1
ID: 39769937
It still showing a big gap between Objectives and Test
0
 
LVL 58

Expert Comment

by:Gary
ID: 39769944
It will never be perfect any way using tables.

To add a line break in a table cell just use <br>
0
 

Author Comment

by:mustish1
ID: 39769949
The BR tag kick out the text from the table.
0
 
LVL 58

Expert Comment

by:Gary
ID: 39769962
0
 

Author Comment

by:mustish1
ID: 39769969
Sorry I use outside the td code. Same thing a big gap

<html>
<head></head>
<body>
<table border = "1" align = "center">
<tbody>
<tr>
<td><h2>Objectives</h2>
<br>kkkkk</br>
</td>
<td align="center"><img src="camel.png" />
</td>
</tr>
</tbody>
</table>
</body>
</html>
0
 
LVL 58

Expert Comment

by:Gary
ID: 39769972
There is a gap because H2 has an automatic margin - add this to your page

<style>
h2 {
margin:0;
padding:0;
}
</style>

Open in new window

0
 

Author Comment

by:mustish1
ID: 39769979
Thanks. It comes up but still looks line a line gap.

<style>
h2 {
margin:0;
padding:0;
}
</style>
<html>
<head></head>
<body>
<table border = "1" align = "center">
<tbody>
<tr>
<td><h2>Objectives</h2>
<br>kkkkk</br>
</td>
<td align="center"><img src="camel.png" />
</td>
</tr>
</tbody>
</table>
</body>
</html>
0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39769990
You don't need a <br> after the H2 tag as it will automatically go to a new line.
<style>
h2 {
margin:0;
padding:0;
}
</style>
<html>
<head></head>
<body>
<table border = "1" align = "center">
<tbody>
<tr>
<td style="vertical-align:top"><h2>Objectives</h2>
kkkkk</br>
</td>
<td align="center"><img src="camel.png" />
</td>
</tr>
</tbody>
</table>
</body>
</html> 

Open in new window

0
 

Author Closing Comment

by:mustish1
ID: 39770005
Thanks I have to play with the BR.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Auto Complete Using JQuery 5 92
jQuery or Javascript animation question 6 72
Where do I learn ES6? 3 81
Animated .jpg? 13 104
Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will learn how to count occurrences of each item in an array.

735 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