Hour 17 Code Samples – Sams Teach Yourself Responsive Web Design in 24 Hours

Hour 17 Code Samples – Sams Teach Yourself Responsive Web Design in 24 Hours

Listing 17.1

Listing 17.2

Listing 17.3

Listing 17.4

Listing 17.5

Listing 17.6

Listing 17.7

2 thoughts on “Hour 17 Code Samples – Sams Teach Yourself Responsive Web Design in 24 Hours

  1. Dear Jennifer

    I bought your “Sams Teach Yourself Responsive Web Design in 24 Hours by Jennifer Kyrnin” from Amazon as it seemed to be the only book that addressed the problem of data tables in RWD. However, in your otherwise excellent book, I am disappointed that there is some inconsistency in that content should not be included in CSS, which is for layout only.

    I bought the book as I am updating a rather old-fashioned charity website here in the UK of which I am a Trustee and which I wanted to be a RWD that can be read on mobiles and tablets as well. It has more than one data tables with different pricing information in different pages of the website.

    However, if I understand the book properly in my preferred method, in listing 17.4, you are advocating labelling the titles in the CSS. Surely this is not strictly correct and would not validate with W3C? I have not tried it yet and this is less important to me than a workable site. If I have one CSS file for the site, as recommended, is it acceptable to separate the rest of the CSS from the “/* Label the data */” code and put it into the CSS and leave the labelling CSS code in the individual HTML5 pages so that different tables can be used on the site? And would this validate? Also what would happen if there was more than one table on the HTML5 page?

    It seems to me that there must be a method of coding the tables without having data in the CSS or leaving CSS on the HTML pages, but I am not clever enough to work out how to do it. As you clearly are, I am writing to you in the hope that you have addressed and solved this problem since you wrote the book.

    Yours sincerely

    1. I agree that content shouldn’t be included in the CSS. But there are not a lot of options for creating responsive tables, especially if you cannot use scripts. And many people cannot. Tables are very difficult, and most designers choose to make sacrifices in either their CSS by including content there or in other ways, such as by making them non-responsive. Personally, I would choose a responsive table over a non-responsive one, but every design is different and there will be cases where including content in the CSS is not appropriate.

      Thanks for your comment. This is good information for others reading the book.

Leave a Reply

Your email address will not be published.