Solved

2nd Line Same Column

Posted on 2014-01-09
17
234 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 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

738 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