WordPress.org

Ready to get started?Download WordPress

Forums

table widths (6 posts)

  1. thomaspayne
    Member
    Posted 3 years ago #

    hello.

    wondered if anyone could provide direction on how to set widths of individual cells in a table. basically have used a row to create a horizontal scroll effect and need to set the width of the first cell in the table to 400px.

    thought it would just be <td width="400"> but doesn't seem to work.

    the page in question is:

    http://thomasjwpayne.com/dbuckingham/?page_id=11

  2. MrGamma
    Member
    Posted 3 years ago #

    I couldn't find width="400" in your code.

    style="width: 400px !important;"

    I found that though. Sometimes the width the table will effect how wide a cell can be.

    Maybe if you set the table to width="100%" and then make sure you have at least two TD cells, so that one can compensate for the remaining width of the table.

  3. thomaspayne
    Member
    Posted 3 years ago #

    yeah sorry.

    was just checking if inline css would affect it. didnt seem to do much.

    yeah there will always be multiple td cells but not sure what you've recommended would work, unless i've misunderstood.

    basically need the opening cell to always stay fixed at 400px.

    anybody?

  4. MrGamma
    Member
    Posted 3 years ago #

    table-layout:fixed

  5. thomaspayne
    Member
    Posted 3 years ago #

    yeah think i see what you mean now. works for the text although not for the images which end up on top of each other, even with all td's set to width=100%.

    imagined there were be some method using css to affect only the first column so the remaining columns can be flexible depending on image width?

  6. MrGamma
    Member
    Posted 3 years ago #

    Hello Thomas,

    All the TDS can only equal the 100% in total.

    If there are three TDs they need to equal 33% each. That might be causing some problems.

    A bad hack but should work fine on the newer computers is to set image widths to 100% so they scale to fit the width of the TDs.

    Tables will not clip images from what I remember. So in the worst case, you might need to wrap an image in a div and then set the width of the div to what you need it to be and then add an overflow:hidden to clip the image.

    Is that what you mean?

Topic Closed

This topic has been closed to new replies.

About this Topic