Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

HTML Code

Posted on 2006-07-18
7
Medium Priority
?
237 Views
Last Modified: 2006-11-18
Could someone check what is wrong with my syntax.

Here it is
<HTML>
<HEAD>
<TITLE>Column Span</TITLE>
 
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR></HEAD>
 
 
<TABLE cellSpacing=0 cellPadding=0 width=75% border=1>
 
  <TBODY>
 
  <TR>
    <TD vAlign=top align=left width=100>    This is my first table cell in the top row. </TD>
 
    <TD vAlign=top align=left width=100>This is my second table cell in the
      top row. </TD>
    <TD vAlign=top align=left width=100>This is my third table cell in the top
      row. </TD>
    Align=top align=left width=100>This is my fourth table cell in the
      top row. </TD>
<td>  Added row</TD>
  </tr>
 

<TR>
 
    <TD vAlign=top align=left width=100>This is my first table cell in the
      bottom row. </TD>
    <TD vAlign=top align=left width=300 colSpan=3>This is my second table cell
      in the bottom row. </TD>
</TR>
 
 
 
</TBODY>
</TABLE>
 
</BODY>

0
Comment
Question by:Higante
7 Comments
 
LVL 5

Expert Comment

by:koolie
ID: 17135693
your missing the  <td  on the first row, as well as you have to aligns in that cell.  you needed valign.  Here is the corrected code. For future reference, use all caps or all lowercase inside of your tags(just better practice, but you never know when IE is gonna mess with you)  Also, quote your attribues (ex.  valign="top")  A good wysiwyg editor will help you.  Dreamweaver if you can afford it or try something like coffee cup editor http://www.coffeecup.com/

<HTML>
<HEAD>
<TITLE>Column Span</TITLE>
 
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR></HEAD>
 
 
<TABLE cellSpacing=0 cellPadding=0 width=75% border=1>
 
  <TBODY>
 
  <TR>
    <TD vAlign=top align=left width=100>    This is my first table cell in the top row. </TD>
 
    <TD vAlign=top align=left width=100>This is my second table cell in the
      top row. </TD>
    <TD vAlign=top align=left width=100>This is my third table cell in the top
      row. </TD>
        
    <td valign=top align=left width=100>This is my fourth table cell in the
      top row. </TD>
  </tr>
 

<TR>
<td>  Added row</TD>

 
    <TD vAlign=top align=left width=100>This is my first table cell in the
      bottom row. </TD>
    <TD vAlign=top align=left width=300 colSpan=2>This is my second table cell
      in the bottom row. </TD>
</TR>
 
 
 
</TBODY>
</TABLE>
 
</BODY>
</HTML>
0
 
LVL 5

Assisted Solution

by:koolie
koolie earned 1000 total points
ID: 17135698
woops...you need a body tag as well

<HTML>
<HEAD>
<TITLE>Column Span</TITLE>
 
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR></HEAD>
 
 <body>
<TABLE cellSpacing=0 cellPadding=0 width=75% border=1>
 
  <TBODY>
 
  <TR>
    <TD vAlign=top align=left width=100>    This is my first table cell in the top row. </TD>
 
    <TD vAlign=top align=left width=100>This is my second table cell in the
      top row. </TD>
    <TD vAlign=top align=left width=100>This is my third table cell in the top
      row. </TD>
       
    <td valign=top align=left width=100>This is my fourth table cell in the
      top row. </TD>
  </tr>
 

<TR>
<td>  Added row</TD>

 
    <TD vAlign=top align=left width=100>This is my first table cell in the
      bottom row. </TD>
    <TD vAlign=top align=left width=300 colSpan=2>This is my second table cell
      in the bottom row. </TD>
</TR>
 
 
 
</TBODY>
</TABLE>
 
</BODY>
</HTML>
0
 
LVL 1

Expert Comment

by:dharmeshmaniar
ID: 17137152
u have missed start of <body> tag after </head>
0
Industry Leaders: 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!

 

Author Comment

by:Higante
ID: 17140172
koolie,

I am not sure what you mean about the missing <td> in the first row.  I could not locate this part.
0
 
LVL 17

Accepted Solution

by:
Suat Ozgur earned 1000 total points
ID: 17142374
Hi,

Please read the modified code below.

<html>
<head>
<title>Column Span</title>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252" />
<meta content="MSHTML 6.00.2800.1400" name=GENERATOR />
</head>
<body>
<table cellSpacing="0" cellPadding="0" width="400px" border="1">
  <tbody>
  <tr>
    <td vAlign="top" align="left" width="100px">This is my first table cell in the top row. </td>
    <td vAlign="top" align="left" width="100px">This is my second table cell in the top row. </td>
    <td vAlign="top" align="left" width="100px">This is my third table cell in the top row. </td>
    <td vAlign="top" align="left" width="100px">This is my fourth table cell in the top row. </td>
  </tr>
  <tr>
    <td vAlign="top" align="left" width="100px">This is my first table cell in the bottom row. </td>
    <td vAlign="top" align="left" width="300px" colSpan=3">This is my second table cell in the bottom row.</td>
  </tr>
  </tbody>
</table>
</body>
</html>

If you need to make table width = 75% then also use % for the cell widths like below:

<table cellSpacing="0" cellPadding="0" width="75%" border="1">
  <tbody>
  <tr>
    <td vAlign="top" align="left" width="25%">This is my first table cell in the top row. </td>
    <td vAlign="top" align="left" width="25%">This is my second table cell in the top row. </td>
    <td vAlign="top" align="left" width="25%">This is my third table cell in the top row. </td>
    <td vAlign="top" align="left" width="25%">This is my fourth table cell in the top row. </td>
  </tr>
  <tr>
    <td vAlign="top" align="left" width="25%">This is my first table cell in the bottom row. </td>
    <td vAlign="top" align="left" width="75%" colSpan=3">This is my second table cell in the bottom row.</td>
  </tr>
  </tbody>
</table>

Since I saw that you wanted the same width, I used 25% for the cells. However you should change them according to column number (20% for 5 columns).
Also, you don't have to set width property for the second row since the first row will do the job (in this sample).

I hope it helps.

Suat
0
 
LVL 17

Expert Comment

by:Suat Ozgur
ID: 17142386
typo:
colSpan=3" should be colSpan="3" in the modified codes in my post above.

Suat
0
 
LVL 1

Expert Comment

by:maonas
ID: 17147119
try this:

<HTML>
<HEAD>
<TITLE>Column Span</TITLE>
 
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR></HEAD>
 
<body>
<TABLE cellSpacing=0 cellPadding=0 width=75% border=1>
<TBODY>
 
 <TR>
    <TD vAlign=top align=left width=100>This is my first table cell in the top row. </TD>
    <TD vAlign=top align=left width=100>This is my second table cell in the top row. </TD>
    <TD vAlign=top align=left width=100>This is my third table cell in the top row. </TD>
    <td vAlign=top align=left width=100>This is my fourth table cell in the top row. </TD>
 </tr>
 <tr>
      <td colspan=4> Added row</TD>
 </tr>
 <TR>
    <TD vAlign=top align=left width=100>This is my first table cell in the bottom row. </TD>
    <TD vAlign=top align=left width=300 colSpan=3>This is my second table cell in the bottom row. </TD>
 </TR>
</TBODY>
</TABLE>
 
</BODY>
</html>
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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

885 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