www.webdeveloper.com
Results 1 to 14 of 14

Thread: Colspan and rowspan ruining cell dimensions

  1. #1
    Join Date
    Jul 2007
    Posts
    9

    Unhappy Colspan and rowspan ruining cell dimensions

    I need to accomplish a layout like this:
    Code:
    <table>
    	<tr>
    		<td colspan=2 rowspan=2>? by ?</td>
    		<td width=7 height=7>7x7</td>
    	</tr>
    	<tr>
    		<td height=7>?x7</td>
    	</tr>
    	<tr>
    		<td height=7 width=7>7x7</td>
    		<td height=7>?x7</td>
    		<td height=7 width=7>7x7</td>
    	</tr>
    </table>
    <!--
    expected:
    _____________
    | ? x ? |7x7|
    |       |7x?|
    |7x7|?x7|7x7|
    
    actual (ie):
    __________________
    | ? x ?     |7x?/2|
    |           |7x?/2|
    |?/2x7|?/2x7| 7x7 |
    -->

    Any idea how to overcome this ie oddity?

  2. #2
    Join Date
    Jul 2007
    Posts
    9

    Clarification

    There was some confusion in another forum regarding my explanation, so here's my clarification:

    "?" is the variable height of the large cell. In the cases of cells 0,3 and 1,3 "?/2" indicates that their height is half that of the large cell.

    Instead I need: height of 0,3 = 7; height of 1,3 = ?-7.

  3. #3
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    You are contradicting yourself; in the first post all heights are set to 7px and the second post you have a problem with height.

    As it's for a layout you should be using css.
    At least 98% of internet users' DNA is identical to that of chimpanzees

  4. #4
    Join Date
    Jul 2007
    Posts
    9
    Quote Originally Posted by Fang
    You are contradicting yourself; in the first post all heights are set to 7px and the second post you have a problem with height.
    It happens with both height and width. I'll simplify:
    Code:
    _________________________
    | x height | 5 height   |
    |          | x-5 height |
    As it's for a layout you should be using css.
    I've tried. Couldn't come up with a solution. If you can, please advise.

  5. #5
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Why do you need to fix the height/width?
    Give a practical example of the problem.
    At least 98% of internet users' DNA is identical to that of chimpanzees

  6. #6
    Join Date
    Jul 2007
    Posts
    9
    I'm making a dropshadow using pngs with alpha transparencies. I need 3 corner images and tiling edges.

  7. #7
    Join Date
    Jul 2007
    Posts
    219
    http://www.alistapart.com/articles/cssdropshadows/

    This should get you to where you're trying to go. :]

  8. #8
    Join Date
    Jul 2007
    Posts
    9
    Quote Originally Posted by Ferret
    http://www.alistapart.com/articles/cssdropshadows/

    This should get you to where you're trying to go. :]
    I've read that very article already, actually.

    It's great for static-sized shadows. But I'm looking to make a dynamic sized one.

  9. #9
    Join Date
    Jul 2007
    Posts
    9
    What I'm trying to accomplish is a dynamically sizing drop shadow frame using png images. So I need a static sized corners and stretching edges so it'll fit whatever I put inside it.

    This works beautifully in firefox but not ie:
    Code:
    <style>
    
    .shadow .topright {
    	background-image: url(images/shadow.top-right.png);
    	background-position: top right;
    	background-repeat: no-repeat;
    	margin-top: 7px;
    }
    
    .shadow .right {
    	background-image: url(images/shadow.right.png);
    	background-position: right;	
    	background-repeat: repeat-y;
    }
    .shadow .bottomleft {
    	background-image: url(images/shadow.bottom-left.png);
    	background-position: bottom left;	
    	background-repeat: no-repeat;
    }
    .shadow .bottom {
    	background-image: url(images/shadow.bottom.png);
    	background-position: bottom;	
    	background-repeat: repeat-x;
    }
    .shadow .bottomright {
    	background-image: url(images/shadow.bottom-right.png);
    	background-position: bottom right;
    	background-repeat: no-repeat;
    }
    
    .shadow .content {
    	padding: 5px;
    }
    </style>
    <body>
    	<table class="shadow" cellpadding=0 cellspacing=0>
    		<tr>
    			<td colspan=2 rowspan=2 class="content">dynamic content goes here</td>
    			<td class="topright" width=7 height=7><img src="images/spacer.png"></td>
    		</tr>
    		<tr>
    			<td class="right"><img src="images/spacer.png"></td>
    		</tr>
    		<tr>
    			<td class="bottomleft" height=7 width=7><img src="images/spacer.png"></td>
    			<td class="bottom"><img src="images/spacer.png"></td>
    			<td class="bottomright" height=7 width=7><img src="images/spacer.png"></td>		
    		</tr>
    	</table>
    </body>

  10. #10
    Join Date
    Jul 2007
    Posts
    219
    Quote Originally Posted by zaxnyd
    I've read that very article already, actually.

    It's great for static-sized shadows. But I'm looking to make a dynamic sized one.
    But that is for dynamically sized shadows: you resize the background image based on the size of the image you're placing.

    If you read the source material (linked toward the top of the article I linked you to) it states that the shadow image is actually 800x800, resized as needed.

    Simple solutions are more often the most effective. :]

  11. #11
    Join Date
    Jul 2007
    Posts
    9
    That's an alternative which I'll definitely consider. Thanks.

    However, I'd still like to accomplish my proposed layout.

  12. #12
    Join Date
    Jul 2007
    Posts
    9
    Still no luck on my end. Any more suggestions? =\

  13. #13
    Join Date
    Jul 2007
    Posts
    9

    Solved.

    I stumbled upon the answer.

  14. #14
    Join Date
    Jul 2007
    Posts
    219
    Quote Originally Posted by zaxnyd
    I stumbled upon the answer.

    Nicely done. If you notice, that page uses the link I provided as one of it's sources later on in the article. :P

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

"

"

X vBulletin 4.2.2 Debug Information

  • Page Generation 0.16654 seconds
  • Memory Usage 2,983KB
  • Queries Executed 13 (?)
More Information
Template Usage (34):
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (3)bbcode_code
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (14)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (14)postbit
  • (14)postbit_onlinestatus
  • (14)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (70):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates