Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
CSS Cascading Style Sheets All issues relating to Cascading Style Sheets (CSS).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the CSS Cascading Style Sheets section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old September 6th, 2005, 09:19 AM
Registered User
Points: 1,897, Level: 17
Points: 1,897, Level: 17 Points: 1,897, Level: 17 Points: 1,897, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2005
Location: Mumbai, Maharastra, India.
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default CSS for td.

Hi

What would be CSS for <td>, if we want to stop the text insied <td> to be in two line.

Further, width of all <td> should be same, irrespecive of text inside <td> tag.

Rupen Anjaria.:)
------------------
We CAN'T avoid problems, but can solve it.
  #2 (permalink)  
Old September 6th, 2005, 09:34 AM
Friend of Wrox
Points: 1,315, Level: 14
Points: 1,315, Level: 14 Points: 1,315, Level: 14 Points: 1,315, Level: 14
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: , , .
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
Default

td { width: 6em; white-space: nowrap }

http://www.w3.org/TR/REC-CSS2/text.h...ef-white-space
http://www.w3.org/TR/REC-CSS2/visude...#propdef-width

--
http://yupapa.com
  #3 (permalink)  
Old September 6th, 2005, 10:14 AM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

I think table-layout would be better for forcing a width, perhaps in combination with what meow has already suggested.

table {
    table-layout: fixed;
}

http://www.w3.org/TR/REC-CSS2/tables...f-table-layout

Tables widths are intrinsically different from width as applied to other elements (suchas block elements). Widths and heights within tables behave more like minimum widths and heights, and contract or expand to accomodate content within those cells. The table-layout property provides a way of enforcing this traditional sizing algorithm (the "auto" value of this property), or a fixed sizing algorithm (the "fixed" value of this property), where when fixed is specified, the widths and heights are adhered to strictly.

You may also need the "overflow" property, if cell content will be at all clipped, in some browsers the overflow is visible (in Explorer it is clipped where tables are concerned, in Mozilla it is visible).

http://www.w3.org/TR/REC-CSS2/visufx.html#overflow

HTH!

Regards,
Rich

--
[http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design


Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS HELP:! CSS EXPANDIBLE BACKGROUND FOR TITLE phpuser2000 CSS Cascading Style Sheets 2 December 19th, 2007 12:36 AM
Rich's new CSS book: Beginning CSS 2nd Edition jminatel BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 0 June 15th, 2007 11:55 AM
get INPUT value within TD Kabe Javascript How-To 2 May 1st, 2007 06:50 PM
td abbr crmpicco HTML Code Clinic 6 June 14th, 2005 08:27 AM
LENGTH OF TD viren_balaut Javascript How-To 1 September 8th, 2004 08:43 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.