By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,491 Members | 1,212 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,491 IT Pros & Developers. It's quick & easy.

table resizing: want fixed col widths as %, not as ems?

P: n/a
<facts>
I have a "month calendar" that always displays exactly 42 days... and
alongside is a vertical box that displays the detail (form fields) of any
particular select event that appears on the calendar, so that the event may
be changed, or a new event may be created.

monthname
X X X X X X X form
X X X X X X X form
X X X X X X X form
X X X X X X X
X X X X X X X
X X X X X X X

My CSS and XHTML validates per w3c.
Calendar is a <table> contained in a <div (float:left; width:80%)>.
Detail form elements contained in <div (float:right; width:20%;)>.
Consenus of this usenet group was to use <table> for the calendar.
My audience is small - so I only need to please popular recent user agents
(NN7, IE6, Konq3.2...), no need to get midevil.
</facts>

<issue>
The cells automagically expand to fit the contents... this was expected
based on the HTML spec - but also undesirable. When I specify
table-layout:fixed including widths expressed as percentages, the cells
still expand to fit the contents(?!). If I instead express widths using
ems, then I successfully obtain fixed cell widths but table resizing does
not occur, and the calendar may overlap the form if the window is reduced
in size. I read a similar posting where table cell widths were controlled
by placing a div in each cell with a specified width - my tests indicate
this approach also will not allow resizing.

monthname
X X X XXX X form <-- undesirable overlap as a result of resizing window
X X X XXX X form
X X X XXX X form
X X X XXX X X X
X X X XXX X X X
X X X XXX X X X <-- undesirable middle column expanding to fit contents

</issue>

<question>
Can I control the widths of the columns as if they are a percentage of the
table's div container... since explicit widths (e.g. "7em") don't
facilitate resizing of the table? Ideally every column will always be:
80% (table's div) / 7 = 11.4% of the entire screen width
</question>

<URL>
(youll need to replace the numbers with DIGITS)
http://twentyfour.thirty.onesixtysix..._Name=calendar
</URL>
--
TJ Talluto
torpedo51 at yahoo dot com
Jul 20 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.