Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: CSS Mysterys

  1. #1
    Join Date
    Feb 2010
    Posts
    106

    Default CSS Mysterys

    Okay, styling a table shouldn't be dreadfully tricky

    Why, then, are my cells not lining up dispite having widths defined by classes?

    http://fitzgraham.netne.net/wordpress/timetable/
    Last edited by Ryan; 02-16-2010 at 07:11 PM.

  2. #2
    Join Date
    Feb 2010
    Posts
    106

    Default

    seems to be my 'location' cell playing up, but they all have defined widths.

  3. #3
    Join Date
    Feb 2009
    Location
    St. Louis, MO
    Posts
    1,997

    Default

    These might be conflicting a little bit:

    HTML Code:
    table.mf_timetable {
    	width: 900px;
    }
    
    table.mf_timetable table.subtable td.location {
    	width: 2035px;
    }
    Your containing table is defined as 900px width, but your location TD inside your sub-table is defined as 2035px.

    Out of curiosity, why are you bothering at all with tables?

    Using a UL might be easier to code, and to style...

    HTML Code:
    <ul class="mf_timetable">
      <li class="day">Mon</li>
      <li class="subtable">
         <ul class="modern">
            <li class="class body">Primary Modern</li>
            <li class="location body">Pewsham Community Centre</li>
            <li class="time body">03:30:00 - 04:00:00</li>
            <li class="teacher body">Miss Beccy</li>
            <li class="cost body">3.50</li>
            <li class="category body">modern</li>
         </ul>
      </li>
    </ul>
    And that way, you don't have to worry about the wonkiness of table styling.

    Just a thought. :)
    WP TurnKey - Turn-Key WordPress installation and maintenance services
    WordPress user since 2005 | @chip_bennett | chipbennett.net | cbnet Plugins

  4. #4
    Join Date
    Feb 2010
    Posts
    106

    Default

    It's tabular data, so I started using tables. There is a lot of PHP generating that table.

  5. #5
    Join Date
    Feb 2010
    Posts
    106

    Default

    Have made the change, only thing it effects is total width, seems the <td> widths are having little or no effect.

  6. #6
    Join Date
    Apr 2009
    Location
    Memphis, TN
    Posts
    865

    Default

    Fixed link (yours goes to "localhost"): http://fitzgraham.netne.net/wordpress/timetable/

    Anyway, answer: Use col tags to specify the width:
    http://www.quackit.com/html_5/tags/html_col_tag.cfm

  7. #7
    Join Date
    Feb 2010
    Posts
    106

    Default

    Quote Originally Posted by Otto View Post
    Fixed link (yours goes to "localhost"): http://fitzgraham.netne.net/wordpress/timetable/
    Copied and pasted wrong link, then edited. Seems I only edited the inner HTML

  8. #8
    Join Date
    Feb 2010
    Posts
    106

    Default

    So I should define col's for each subtable?

  9. #9
    Join Date
    Feb 2009
    Location
    St. Louis, MO
    Posts
    1,997

    Default

    Quote Originally Posted by Otto View Post
    Fixed link (yours goes to "localhost"): http://fitzgraham.netne.net/wordpress/timetable/

    Anyway, answer: Use col tags to specify the width:
    http://www.quackit.com/html_5/tags/html_col_tag.cfm
    Is that HTML 5 specific?

    What about defining max-width and min-width (defining them the same as width)?
    WP TurnKey - Turn-Key WordPress installation and maintenance services
    WordPress user since 2005 | @chip_bennett | chipbennett.net | cbnet Plugins

  10. #10
    Join Date
    Jan 2009
    Location
    New Zealand
    Posts
    2,801

    Default

    Quote Originally Posted by chipbennett View Post
    Is that HTML 5 specific?
    No, it's old school :)

    You should also be able to define a width on the TD tag itself.

Posting Permissions

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