CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Table Basics

  1. #1
    Join Date
    Feb 2002
    Location
    Makati City, Philippines
    Posts
    1,054

    Table Basics

    Hi there,

    I'm new to HTML. Please help me out on a table like this.
    Code:
    +-------------------+
    |                   |
    +---+-------+-------+
    |   |       |       |
    |   +-------+-------+
    |   |               |
    +---+---------------+
    No need for dimensions and other things. I am just confused on the codes for columns and rows that overlaps.

    Thanks
    Marketing our skills - please participate in the survey and share your insights
    -

  2. #2
    Join Date
    Mar 2002
    Location
    NY
    Posts
    236
    Code:
    <table border="1" width="100%">
      <tr>
        <td width="100%" colspan="3">&nbsp;</td>
      </tr>
      <tr>
        <td width="50%" rowspan="2">&nbsp;</td>
        <td width="25%">&nbsp;</td>
        <td width="25%">&nbsp;</td>
      </tr>
      <tr>
        <td width="50%" colspan="2">&nbsp;</td>
      </tr>
    </table>
    The easiest way do get a code is to build a table in any HTML editor and view its source.

  3. #3
    Join Date
    Feb 2002
    Location
    Makati City, Philippines
    Posts
    1,054
    Thanks Akim,

    I will test the code later.

    I tried Visual Interderv but can't seem to make it overlap. I probably missed something.

    Besides, I am still learning, so I want it manual and focused on the code. The HTML editor is generating codes including those I don't need. For now, they are still arcane to me.
    Marketing our skills - please participate in the survey and share your insights
    -

  4. #4
    Join Date
    Mar 2002
    Location
    NY
    Posts
    236
    I'm not a "Pro", but know a few things

    Basicaly, <TR></TR> specifies a row in a table.
    Table - 3 Rows and 3 Columns (<TD></TD> specifies a column):
    Code:
    <TABLE id="Table1" width="300" border="1">
    	<TR>
    		<TD></TD>
    		<TD></TD>
    		<TD></TD>
    	</TR>
    	<TR>
    		<TD></TD>
    		<TD></TD>
    		<TD></TD>
    	</TR>
    	<TR>
    		<TD></TD>
    		<TD></TD>
    		<TD></TD>
    	</TR>
    </TABLE>
    COLSPAN (Sets or retrieves the number columns in the table that the object should span.):
    Code:
    <TABLE id="Table1" width="300" border="1">
    	<TR>
    		<TD colspan="2"></TD>   'span 2 first rows
    		<TD></TD>
    	</TR>
    	<TR>
    		<TD></TD>
    		<TD></TD>
    		<TD></TD>
    	</TR>
    	<TR>
    		<TD></TD>
    		<TD></TD>
    		<TD></TD>
    	</TR>
    </TABLE>
    ROWSPAN (Sets or retrieves how many rows in a table the cell should span.)
    Code:
    <TABLE id="Table1" width="300" border="1">
    	<TR>
    		<TD colspan="2"></TD>   'span 2 first rows
    		<TD></TD>
    	</TR>
    	<TR>
    		<TD rowspan="2"></TD> 'span 2 rows
    		<TD></TD>
    		<TD></TD>
    	</TR>
    	<TR>
    		<TD></TD> 
    		<TD></TD>
    	</TR>
    </TABLE>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured