Solved

HTML Code

Posted on 2006-07-18
7
220 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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How to convert code to a png file 22 101
2 CSS questions 11 36
HTML button disabled 11 36
Printing a Google Form 2 9
Do you want to insert HTML5 video into your site? This is the tutorial how to do so. What are the main advantages of HTML5 video? 1) Have good compression, good image quality, and low decode processor use. 2) It is royalty-free 3) It is easi…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

760 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

23 Experts available now in Live!

Get 1:1 Help Now