1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Need help with CSS table design

Discussion in 'CSS' started by steveb, Mar 17, 2007.

  1. #1
    steveb, Mar 17, 2007 IP
  2. bacanze

    bacanze Peon

    Messages:
    2,419
    Likes Received:
    127
    Best Answers:
    0
    Trophy Points:
    0
    #2
    To be honest, a table to display that data is perfectly suitable, as it is tabular data. There is not need to design this in CSS as the table serves the purpose pefectly.
     
    bacanze, Mar 17, 2007 IP
  3. steveb

    steveb Well-Known Member

    Messages:
    1,434
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    175
    #3
    Oh ok, thanks. Will keep it as is then.

    I have my table configured this way, but I can't seem to add padding within the cells for some reason. Any idea why it doesn't let me do this?

     
    steveb, Mar 17, 2007 IP
  4. bacanze

    bacanze Peon

    Messages:
    2,419
    Likes Received:
    127
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hi

    That coding (apart from the missing </table>) will allow you to add both cell padding and spacing. What exatly are you trying to achieve?
     
    bacanze, Mar 17, 2007 IP
  5. steveb

    steveb Well-Known Member

    Messages:
    1,434
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    175
    #5
    Well, if you look at the original link I posted, you will notice that there is no padding within the cells, yet I've put a value of 5 the cellpadding attribute.
     
    steveb, Mar 17, 2007 IP
  6. Xeoro

    Xeoro Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    <table width="100%" border="1">
    <tr>
    <td width="33%" bgcolor="#e0e0e0" padding="5px">
    <b>Bank</b>
    </td>
    <td width="33%" bgcolor="#e0e0e0" padding="5px">
    <b>Location(s)</b>
    </td>
    <td width="33%" bgcolor="#e0e0e0" padding="5px">
    <b>Online Banking?</b>
    </td>
    </tr>
    Code (markup):
    Individual cell padding?
     
    Xeoro, Mar 17, 2007 IP
  7. jakomo

    jakomo Well-Known Member

    Messages:
    4,262
    Likes Received:
    82
    Best Answers:
    0
    Trophy Points:
    138
    #7
    Hello,
    try something like that

    .content {
    width: 750px;
    border: 1px solid #00000;
    }
    .column {
    width: 240px;
    float:right;
    background-color: #e0e0e0;
    padding-left:5px;
    }

    Then in your HTML BODY

    <div class="content">
    <div class="column">
    <b>Bank</b>
    </div>
    <div class="column">
    bla bla bla .....
    </div>
    <div class="column">
    bla bla bla...

    </div>
    </div>

    This is an example....

    Best,
    Jakomo
     
    jakomo, Mar 17, 2007 IP
  8. SolutionX

    SolutionX Peon

    Messages:
    1,161
    Likes Received:
    22
    Best Answers:
    0
    Trophy Points:
    0
    #8
    You can only set padding for the entire table, in the table tag. You could put tables inside each cell and set those table's padding if you want them different, but doesn't look like you do. I think CSS is the better way to go though, for everything possible, because it loads faster and uses less repetative code. I am an old table layout junkie, but now that I'm getting back to web design, discovering I have to learn to use CSS almost from scratch. There is so much importance placed on it these days. I think of it like event driven programming compared to true object oriented programming though. Takes a little more planning, but pays off with speed and if you ever have to make changes.
     
    SolutionX, Mar 17, 2007 IP
  9. Xeoro

    Xeoro Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    CSS is the better way to go for tabular data - since when?
     
    Xeoro, Mar 18, 2007 IP
  10. SolutionX

    SolutionX Peon

    Messages:
    1,161
    Likes Received:
    22
    Best Answers:
    0
    Trophy Points:
    0
    #10
    I'm not really sure yet, maybe combining tables with css classes to format the tables is best with some things? But definately css should be defining everything. If you know better for sure, just say so :)
     
    SolutionX, Mar 18, 2007 IP
  11. Xeoro

    Xeoro Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Formatting things via CSS yes.

    Sorry, I got mixed up
     
    Xeoro, Mar 18, 2007 IP