Solved

HTML Code

Posted on 2006-07-18
7
226 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need help on getting rid of double scroll bars when using iframe 2 26
CSS measurement 10 34
Bootstrap 3 with accordion menu 2 46
Put glyphicon in my input button 4 31
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

864 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

18 Experts available now in Live!

Get 1:1 Help Now