Jump to content


Problem with DiV, Tables and CSS


3 replies to this topic

#1 wp1

    Young Padawan

  • Members
  • Pip
  • 2 posts

Posted 09 January 2008 - 08:03 AM

Hello!

I read the excellent Tutorial on the site regarding Tableless Layouts and learned a lot.

However, I did not see how one would write code to convert tables to css div tags and XHTML validated layout for Tables with multiple TR tags and TD tags from the wonderful tutorial at
http://www.pixel2life.com/publish/tutorial...lidated_layout/

EXAMPLE / QUESTION
How would one write a validated code and working.css file for the following table with multiple TR tags and TD tags?

 <TABLE>
 
 <TR>
 <TD>
   Something
   </TD>
 <TD>
 Something
 </TD>
 </TR>
 
 <TR>
   <TD COLSPAN="2">
	 Something
	 </TD>
   </TR>
 
 </TABLE>

Thanks in advance for any and all help with this.

WP

#2 Jacorre

    P2L Jedi

  • Members
  • PipPipPip
  • 824 posts
  • Gender:Male
  • Location:USA
  • Interests:Computers, Technology, Internet, Graphic/Web Design, Music, Soccer

Posted 09 January 2008 - 10:28 AM

I don't think there's a clear cut way to convert a table to css. It's really a matter of looking at your overall design, deciding how you are going to slice the images, and then putting them back together using CSS instead of tables. Take a look at CSS Slicing Guide.

#3 wp1

    Young Padawan

  • Members
  • Pip
  • 2 posts

Posted 09 January 2008 - 12:39 PM

View PostJacorre, on Jan 9 2008, 10:28 AM, said:

I don't think there's a clear cut way to convert a table to css. It's really a matter of looking at your overall design, deciding how you are going to slice the images, and then putting them back together using CSS instead of tables. Take a look at CSS Slicing Guide.

Hi Jacome!

Thank you for responding.

I was not asking about an image. I need to place text into different cells with different background colors and other stuff.

Would I use CSS slicing to achieve this or is there another way to approach it?

Again thanks in advance for any and all responses

WP

#4 Jacorre

    P2L Jedi

  • Members
  • PipPipPip
  • 824 posts
  • Gender:Male
  • Location:USA
  • Interests:Computers, Technology, Internet, Graphic/Web Design, Music, Soccer

Posted 18 January 2008 - 05:17 PM

You can apply different css styles per cell by using IDs (if it's only once on the page) or Classes (if it's used multiple times on the page). For example:

<td class="something">Here is some text</td>

The class named "something" would have the style you want defined in either an external css file or within the head section of the page.

Edited by Jacorre, 18 January 2008 - 05:18 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users