We help IT Professionals succeed at work.

Easy html problem

rossoneris
rossoneris asked
on
287 Views
Last Modified: 2012-05-06
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

Comment
Watch Question

Commented:
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>


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?...

Author

Commented:
I want the cell at the right to be left. But even I resize the width it stays as it now
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
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.
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

Author

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

Commented:
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.

Author

Commented:
Here is what I want - I had made this line in paint

Author

Commented:
here is the photo
error.jpg
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Commented:
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

Commented:
Rossineris, you want want to consider using divs rather than tables for layout.
rossoneris, did my code work for you?
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>

Author

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

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.
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.

Author

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
<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>
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.