Solved

2nd Line Same Column

Posted on 2014-01-09
17
235 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
Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

 
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

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

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

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Suggested Courses

622 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