Grow your CSS skills. Land your dream job.

Table column & media query

  • # January 5, 2013 at 9:23 am

    Good morning all,
    How would I set the first column of table to certain width let’s say @max-width 30em ? I don’t mind that the company name wraps but the next column has phone number and I don’t want this to wrap.
    [Here’s the link…](http://codepen.io/jiri/collab/Emywb “”)

    # January 5, 2013 at 10:07 am

    I think first-child or first of type would work. On iPad at the mo but think that should do the trick.

    So

    tr td:first-child { max-width: Xxx; }

    Edit: Yes it works.

    # January 5, 2013 at 10:24 am

    @andy_unleash, it didn’t work for me Andy, but after playing around I came up with this:

    tbody > tr > th:first-child { width: 25%; }

    and it works

    # January 5, 2013 at 5:56 pm

    @jurotek – were it Max width what you’re using would just change the column title box though, rather than the entire column.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".