Solved

2nd Line Same Column

Posted on 2014-01-09
17
230 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
  • 9
  • 8
17 Comments
 

Author Comment

by:mustish1
Comment Utility
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
Comment Utility
<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
Comment Utility
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
 
LVL 58

Expert Comment

by:Gary
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

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

Expert Comment

by:Gary
Comment Utility
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
Comment Utility
The BR tag kick out the text from the table.
0
 
LVL 58

Expert Comment

by:Gary
Comment Utility
0
 

Author Comment

by:mustish1
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks I have to play with the BR.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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 …
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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…

728 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now