Easy html problem

I have a problem with my html - somehow the "contens" row is placed right - I want it to be left and it wont work no matter what. Is there somekind of html problem
<html>
 
<head>
<meta http-equiv="Content-Language" content="da">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 6</title>
</head>
 
<body>
 
<table border="1" width="100%">
	<tr>
		<td width="860" height="100" valign="top" colspan="4">&nbsp;</td>
	</tr>
	<tr>
		<td width="887" height="27" valign="top">&nbsp;</td>
		<td width="42" height="27" valign="top">&nbsp;</td>
		<td width="41" height="27" valign="top">&nbsp;</td>
		<td width="33" height="27" valign="top">&nbsp;</td>
	</tr>
	<tr>
		<td width="430" height="600" valign="top" colspan="2">&nbsp;</td>
		<td width="430" height="600" valign="top" colspan="2">content</td>
	</tr>
</table>
 
</body>
 
</html>

Open in new window

rossonerisAsked:
Who is Participating?
 
ITHelper80Connect With a Mentor Commented:
Ok here you go. Had to create two seperate tables to get what you require.
<html>
 
<head>
<meta http-equiv="Content-Language" content="da">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 6</title>
    <style type="text/css">
        .style1
        {
            width: 147px;
            height: 489px;
        }
        .style2
        {
            height: 489px;
        }
    </style>
</head>
 
<body>
 
<table border="1" width="100%">
	<tr>
		<td width="860" height="100" valign="top" colspan="4">&nbsp;</td>
	</tr>
	<tr>
		<td width="887" height="27" valign="top">&nbsp;</td>
		<td width="42" height="27" valign="top">&nbsp;</td>
		<td width="41" height="27" valign="top">&nbsp;</td>
		<td width="33" height="27" valign="top">&nbsp;</td>
</tr>
</table>
 
    <table width="100%" border="1">
        <tr>
            <td class="style1" valign="top">
                Content</td>
            <td class="style2">
                </td>
        </tr>
    </table>
 
</body>
 
</html>

Open in new window

0
 
alien109Commented:
change:

<tr>
    <td width="430" height="600" valign="top" colspan="2"> </td>
    <td width="430" height="600" valign="top" colspan="2">content</td>
</tr>

to

<tr>

    <td width="430" height="600" valign="top" colspan="2">content</td>
    <td width="430" height="600" valign="top" colspan="2"></td>
</tr>


0
 
amazingwolf1Commented:
Hi
Please re-explain, I see you placed the cell "content" on the right of the page. Switching the two <td> elements will move "Content" cell to the left. Is this what you meant?...
0
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
rossonerisAuthor Commented:
I want the cell at the right to be left. But even I resize the width it stays as it now
0
 
amazingwolf1Commented:
Hi rossoneris,
If I understand you correclty, then you want the cell containing the word 'content" to be swapped with the cell on it's left. If this is the case, then the solution is indeed to swap the code like so:

<td width="430" height="600" valign="top" colspan="2">content</td>
<td width="430" height="600" valign="top" colspan="2">&nbsp;</td>

Otherwise, please repost your code and put in the cells the words "right" and "left" so we can help out.

Thanks
0
 
ITHelper80Commented:
Are you wanting the contents cell to the left or just the word content?

If you are looking for the entire cell to be moved then alien's solution is correct.

If you wont the word content to be moved then use this.

<td width="430" height="600" valign="top" colspan="2" style="text-align: right">content</td>

If its something else, please explain in more detail.
0
 
ITHelper80Commented:
Ive been looking at this more and I think I understand your problem.

The problem is with column span the above column widths affect the ones below it. try this code...it should work for you.
<table border="1" width="100%">
	<tr>
		<td width="860" height="100" valign="top" colspan="4">&nbsp;</td>
	</tr>
	<tr>
		<td height="27" valign="top" class="style2">&nbsp;</td>
		<td height="27" valign="top" class="style1">&nbsp;</td>
		<td width="41" height="27" valign="top">&nbsp;</td>
		<td width="33" height="27" valign="top">&nbsp;</td>
	</tr>
	<tr>
		<td height="600" valign="top" colspan="2">content</td>
		<td width="430" height="600" valign="top" colspan="2">&nbsp;</td>
	</tr>
</table>

Open in new window

0
 
rossonerisAuthor Commented:
It helper - Yes - the cell must be right as you give in the example- but the 3 columns in the small row must be at the right side
0
 
alien109Commented:
I'm confused. Are you sure you're not mixing up what are columns and what are rows?

<tr> determines a row in a table
<td> is a cell within that row.

You don't really define columns in html tables.

Please clarify your question. The above html doesn't have 3 columns, but rather 3 rows with 4 columns.
0
 
rossonerisAuthor Commented:
Here is what I want - I had made this line in paint
0
 
rossonerisAuthor Commented:
here is the photo
error.jpg
0
 
alien109Commented:
The first column in the third row, cannot be more narrow than the first column in the row above. All columns must be equal in width.

Try the following, it will acheive mostly what you are looking for

<html>
 
<head>
<meta http-equiv="Content-Language" content="da">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 6</title>
</head>
 
<body>
 
<table border="1" width="100%">
        <tr>
                <td height="100" valign="top" colspan="5">&nbsp;</td>
        </tr>
        <tr>
                <td width="30" height="27" valign="top">&nbsp;</td>
                <td width="744" height="27" valign="top">&nbsp;</td>
                <td width="42" height="27" valign="top">&nbsp;</td>
                <td width="41" height="27" valign="top">&nbsp;</td>
                <td width="33" height="27" valign="top">&nbsp;</td>
        </tr>
        <tr>
                <td width="30" height="430" valign="top">&nbsp;</td>
                <td width="860" height="430" valign="top" colspan="4">content</td>
        </tr>
</table>
 
</body>
 
</html>

Open in new window

0
 
alien109Commented:
Rossineris, you want want to consider using divs rather than tables for layout.
0
 
ITHelper80Commented:
rossoneris, did my code work for you?
0
 
qwerty021600Commented:
Try this ... I think this is what you want

<html>
 
<head>
<meta http-equiv="Content-Language" content="da">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 6</title>
</head>
 
<body>
 
<table border="1" width="100%">
        <tr>
                <td height="100" valign="top" colspan="5"> </td>
        </tr>
        <tr>
                <td width="43" height="27" valign="top">  </td>
                <td width="822" height="27" valign="top"> </td>
                <td width="23" valign="top"></td>
                <td width="25" valign="top"></td>
          <td width="26" height="27" valign="top"> </td>
        </tr>
        <tr>
                <td height="600" valign="top">content </td>
                <td height="600" valign="top" colspan="4">&nbsp;</td>
        </tr>
</table>
 
</body>
 
</html>
0
 
rossonerisAuthor Commented:
I found the solution
  <table border="0" width="960" height="715" cellspacing="0" cellpadding="0">
    <tr>
      <td colspan="6" width="960" height="155"><div id="altd">
			&nbsp;</div></td>
    </tr>
  <tr>
      <td width="750" height="25" ID="menu" bgcolor="#b71d21">menu</td>
       <td width="20" height="25" bgcolor="#000000"></td>
       <td width="40" height="25" bgcolor="#000000">&nbsp;</td>
      <td width="40" height="25"  bgcolor="#000000">&nbsp;</td>
      <td width="40" height="25" bgcolor="#000000">&nbsp;</td>
      <td width="70" height="25" ID="sp" align="right" bgcolor="#000000">sprog</td>
    </tr>       
          <td width="960" height="535" valign="top" colspan="6">
        <table border="0" width="960" cellspacing="0" cellpadding="0">
          <tr>
            <td width="167" height="535" valign="top" ID="content">content</td>
            <td width="793" height="535" valign="top" background="images/ind.jpg" ID="ind">indmenu</td>
          </tr>
           
  </table>

Open in new window

0
 
ITHelper80Commented:
No to be anal but you used my solution of having two tables. I think I deserve the points. Its not cool to have people help you and then try to close the question.
0
 
ITHelper80Commented:
No to be anal but you used my solution of having two tables. I think I deserve the points. Its not cool to have people help you and then try to close the question.
0
 
rossonerisAuthor Commented:
I have tried manual to change the size of the html - but than somehow an extra row in the bottom is being create.

Could you please make the example with the size 860 height and 727 width
0
 
qwerty021600Commented:
<table border="0" width="960" height="715" cellspacing="0" cellpadding="0">
    <tr>
      <td colspan="6" width="960" height="155"><div id="altd">
                         </div></td>
    </tr>
  <tr>
      <td width="750" height="25" ID="menu" bgcolor="#b71d21">menu</td>
       <td width="20" height="25" bgcolor="#000000"></td>
       <td width="40" height="25" bgcolor="#000000"> </td>
      <td width="40" height="25"  bgcolor="#000000"> </td>
      <td width="40" height="25" bgcolor="#000000"> </td>
      <td width="70" height="25" ID="sp" align="right" bgcolor="#000000">sprog</td>
    </tr>      
          <td width="960" height="535" valign="top" colspan="6">
        <table border="0" width="960" cellspacing="0" cellpadding="0">
          <tr>
            <td width="233" height="860" valign="top" ID="content">content</td>
            <td width="727" height="860" valign="top" background="images/ind.jpg" ID="ind">indmenu</td>
          </tr>
           
  </table>
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.