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 3 of 3
  1. #1
    New Coder
    Join Date
    Apr 2012
    Location
    California
    Posts
    18
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Fixing location of table header at the top regardless number of lines in "td".

    Hello Friends,

    I am asking your help how I can fix this problem regarding a table header in an html layout.
    Below is a table construction with the following information.


    SOURCE CODE

    <div id="content">
    <div id="tableView">
    <table cellspacing="25" >
    <tr>
    <th>Description:</th>
    <td><?php echo $description; ?></td>
    </tr>
    <tr>
    <th>When:</th>
    <td><?php echo $fdate_start; ?></td>
    </tr>
    <tr>
    <th>Time:</th>
    <td><?php echo $time;?></td>
    </tr>
    </div>
    </div><!--end of content-->

    CSS STYLING
    #content {
    width: 760px;
    }

    #tableView {
    width: 100%;
    }

    #tableView table{
    width: 100%;
    }

    #tableView th {
    text-align: right;
    }

    #tableView td {
    text-align: justify;
    }


    WEB PAGE RESULT

    Our rural atmosphere makes the Heritage Foundation
    Pumpkin Patch a wonderful place to pick out your pumpkin.
    Description:
    We have hay rides, animals, pumpkins of every size and great
    photo opportunities. This is our 24th year to offer our family
    a spot in the country along with a little history of La Verne to
    enjoy. School tours begin weekdays Oct. 7th through Oct 30th.
    If your school is interested, please call for reservations


    WHEN:
    August 17, 2014 - Sunday
    TIME:
    6:30pm


    If you see the header "Description" is located at the middle of "th" box if there are several lines of information in the"td" box.

    IT SHOULD LOOK LIKE THIS (showing "Description" header at the top of the "th" box) -->>>>>>>>

    SUMMER CAMP

    Description: Our rural atmosphere makes the Heritage Foundation
    Pumpkin Patch a wonderful place to pick out your pumpkin.
    We have hay rides, animals, pumpkins of every size and great
    photo opportunities. This is our 24th year to offer our family
    a spot in the country along with a little history of La Verne to
    enjoy. School tours begin weekdays Oct. 7th through Oct 30th.
    If your school is interested, please call for reservations.
    When: August 17, 2014 - Sunday
    Time: 6:30pm


    Please help what will be the solution for header "Description" to stay at the top even the "td" have numerous lines.

    I thank you so much for your help in advance. -- JOSE

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,436
    Thanks
    23
    Thanked 629 Times in 628 Posts
    First add the table close tag.
    Then:
    #tableView th {
    text-align: right;
    vertical-align:top;
    }
    Evolution - The non-random survival of random variants.

    "If you leave hydrogen alone, for long enough, it begins to think about itself."

  • Users who have thanked sunfighter for this post:

    espi62 (08-15-2014)

  • #3
    New Coder
    Join Date
    Apr 2012
    Location
    California
    Posts
    18
    Thanks
    7
    Thanked 0 Times in 0 Posts
    Hello Sunfighter

    Thank you highly -- It worked!!!

    JOSE


  •  

    Tags for this Thread

    Posting Permissions

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