Solved

HTML Code

Posted on 2006-07-18
7
227 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 250 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
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.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

770 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