• WP 3.8.1
    Raindrops theme (added CSS in child theme)
    http://nichefind.com (testing host)

    I can’t get the width of the columns in my table to change at all.

    I was able to get the table width to change to 370px with:

    .eventschedule{
       font-size:14px;
    }
    
    table.eventschedule{
       width:370px;
    }

    I was able to affect the th and td elements with:

    td.eventschedule{
       font-size:14px;
    }
    
    .eventschedule th /*note that th.eventschedule doesn't work!*/
    {
       font-size:18px;
       background-color:#cc0001;
       color:#ffffff;
       text-align:center;
    }

    Per the above comment, th.eventschedule appears to differ from .eventschedule th — what is the difference?

    I was able to affect the text alignment, but NOT the column width, with the following CSS.

    .eventtime{ /* also tried td.eventtime and .eventtime td, no joy */
      width:100px !important;
      text-align:right;
    }
    .eventtext{
      width:auto !important;
      text-align:left;
    }

    Could somebody teach me what I need to know to adjust the column widths in this table?

Viewing 1 replies (of 1 total)
  • Thread Starter Howard Harkness

    (@chltx)

    Zero responses.

    After a couple of days of poking around, I managed to get the table appearance close to what I wanted with this CSS.

    /* table appearance ******************** */
    .eventschedule{
       font-size:14px;
    }
    table{
    table-layout:auto;
    }
    table.eventschedule{
       width:340px;
    }
    td.eventschedule{
       font-size:14px;
    }
    .eventschedule th{
       font-size:18px;
       background-color:#cc0001;
       color:#ffffff;
       text-align:center;
    }
    .eventtime{
      width:90px !important;
      text-align:right;
    }
    .eventtext{
      width:auto !important;
      text-align:left;
    }

    I’m going to mark this one resolved, although it’s not really completely. I’m a bit disappointed.

    I wonder if my question was too simple or stupid.

Viewing 1 replies (of 1 total)
  • The topic ‘Setting column width in table’ is closed to new replies.