Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2012
    Posts
    79
    Thanks
    2
    Thanked 1 Time in 1 Post

    how to join two fields of a table

    a simple case - no doubt, but i am in no way able to make the bottom two fields one.

    other than replace them with another embedded table, but it is not elegant.

    please help

    Code:
    <table">
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table>

  • #2
    Regular Coder LearningCoder's Avatar
    Join Date
    Jan 2011
    Location
    The Pleiades
    Posts
    913
    Thanks
    76
    Thanked 28 Times in 28 Posts
    You can use the colspan attribute on ONE of the <td> elements, like so:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head> 
    <title>Title here</title> 
    <style type="text/css">
    
    table {border: 1px solid black;}
    
    td {border: 1px solid black;}
    
    </style>
    
    </head> 
    <body>
    
    
    <table>
      <tr>
        <td>a</td>
        <td>b</td>
      </tr>
      <tr>
        <td colspan="2">c d</td>
      </tr>
    </table>
    
    </body> 
    </html>
    Regards,

    LC.


  •  

    Posting Permissions

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