Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-14-2012, 12:20 PM   PM User | #1
see613
New to the CF scene

 
Join Date: Oct 2012
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
see613 is an unknown quantity at this point
Cool DIV with fixed width in TD with colspan

My code:

Code:
<table style="width: 500px;">
        <tr>
            <td colspan="5">
                <div style="width: 500px;">colspan_5</div>
            </td>              
        </tr>
        <tr>
            <td colspan="1">
                <div style="width: 100px;">colspan_1</div>
            </td> 
            <td colspan="3">
                <div style="width: 300px;">colspan_3</div>
            </td>                
            <td colspan="1"> 
                <div style="width: 100px;">colspan_1</div>
            </td>               
        </tr>  
        <tr>
            <td colspan="2">
                <div style="width: 200px;">colspan_2</div>
            </td> 
            <td colspan="3">
                <div style="width: 300px;">colspan_3</div>
            </td>                
        </tr> 
        <tr>
            <td colspan="5">
                <div style="width: 500px;">colspan_5</div>
            </td>                                
        </tr> 
</table>​
But result looks wrong. (jsfiddle_example)

How can I fix it?
see613 is offline   Reply With Quote
Old 10-14-2012, 04:36 PM   PM User | #2
aaronhockey_09
Regular Coder

 
Join Date: Dec 2010
Posts: 411
Thanks: 21
Thanked 55 Times in 55 Posts
aaronhockey_09 is an unknown quantity at this point
You need to set the width to your TR not just the div inside of it
Although i do no recommend creating a site like this, with tables or inline css.
aaronhockey_09 is offline   Reply With Quote
Old 10-14-2012, 04:36 PM   PM User | #3
aaronhockey_09
Regular Coder

 
Join Date: Dec 2010
Posts: 411
Thanks: 21
Thanked 55 Times in 55 Posts
aaronhockey_09 is an unknown quantity at this point
I mean the width of your TD not TR - sorry about the confusion
aaronhockey_09 is offline   Reply With Quote
Users who have thanked aaronhockey_09 for this post:
see613 (10-14-2012)
Old 10-14-2012, 06:08 PM   PM User | #4
see613
New to the CF scene

 
Join Date: Oct 2012
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
see613 is an unknown quantity at this point
This table is simplified example for jQuery widget.
Your changes works correctly only in Chrome.
http://jsfiddle.net/uDwa4/10
May be something else?
see613 is offline   Reply With Quote
Reply

Bookmarks

Tags
colspan, table

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:29 AM.


Advertisement
Log in to turn off these ads.