Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

2nd Line Same Column

Posted on 2014-01-09
17
Medium Priority
?
238 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
Technology Partners: 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
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 basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

705 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