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 4 of 4
  1. #1
    Regular Coder
    Join Date
    May 2009
    Posts
    164
    Thanks
    75
    Thanked 1 Time in 1 Post

    Table formatting

    Hi guys. Just trying to work out why the following applies now formatting to my table rows
    Code:
    <tr>
            <td>business class flights to <b>Abu Dhabi</b><span>from <b>£1185</b></span></td>
            <td>business class flights to <b>Miami</b><span>from <b>£1365</b></span></td>
            </tr>
    I am basically trying to recreate the following


    I thought a table would be the best way to achieve this, but what I am trying above is to get the text to appear like it does in the image.

    Cheers

    Nick
    Last edited by nick2price; 06-19-2012 at 12:00 AM.

  • #2
    New Coder
    Join Date
    Feb 2012
    Posts
    99
    Thanks
    1
    Thanked 5 Times in 4 Posts
    Add this in your stylesheet

    Code:
    td {
    border:1px solid gray;
    background-color:gray;
    }
    Should give you the box's but you just got to get the colors right.

  • #3
    Regular Coder
    Join Date
    May 2009
    Posts
    164
    Thanks
    75
    Thanked 1 Time in 1 Post
    I actually have my table set up like so
    Code:
    <table id="price-table">
            <tr>
                <td>business class flights to <b>Abu Dhabi</b><span>from <b>£1185</b></span></td>
                <td>business class flights to <b>Miami</b><span>from <b>£1365</b></span></td>
            </tr>
    How do I do it so I target this tables td, as I dont want to just use td as this will affect other tables. I have tried without success the following
    Code:
    #price-table td{
    	border:1px solid gray;
    	background-color:gray;
    }
    Cheers

  • #4
    New Coder
    Join Date
    Feb 2012
    Posts
    99
    Thanks
    1
    Thanked 5 Times in 4 Posts
    I found away to get this to work, here is the code.

    Code:
    <td class="name">business class flights to <b>Abu Dhabi</b><span>from <b>£1185</b></span></td>
            
    <td class="name2">business class flights to <b>Miami</b><span>from <b>£1365</b></span></td>
    Css part

    Code:
    .name{
    	border:1px solid gray;
    	background-color:gray;
    }
    .name2{
    	border:1px solid gray;
    	background-color:gray;
    }
    Change the "name" to what ever you want it to be named. Their might be an easier way to do this but this is the only way i know.
    Last edited by bigcasey123; 06-18-2012 at 11:46 PM.

  • Users who have thanked bigcasey123 for this post:

    nick2price (06-19-2012)


  •  

    Posting Permissions

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