Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Colspan / rowspan - not lining up? 1

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
I have the following
Code:
                    <table class="heading">
                        <thead>
                            <tr>
                                <th class="firm" rowspan="2">Firm</th>
                                <th class="adviser" rowspan="2">Adviser</th>
                                <th class="cnt" title="Submissions" rowspan="2">Subs</th>
                                <th class="cnt" title="Cases Sent for Checking" rowspan="2">Sent</th>                                
                                <th class="colspan3" title="" colspan="3">To be checked</th>                                
                                <th class="cnt" title="Cases Checked" rowspan="2">Check</th>                                
                                <th class="colspan3" title="" colspan="3">Actually checked</th>  
                                <th class="cnt" title="Total No. of Cases Overdue" rowspan="2">Over</th>                                                               
                            </tr>
                            <tr>                                

                                <th class="cnt" title="Risk Only Checks">Risk</th>                            
                                <th class="cnt" title="Standard Checks">Std</th>
                                <th class="cnt" title="Full Checks">Full</th>  
                             
                                <th class="cnt" title="Risk Only Checks">Risk</th>                                                             
                                <th class="cnt" title="Standard Checks">Std</th>
                                <th class="cnt" title="Full Checks">Full</th>
                                                      
                            </tr>
                        </thead>
                    </table>

I thought that would produce a table heading with 12 columns and two rows

1st row = first 4 cols span two rows, the next spans 3 cols, the next two rows, the next spans 3 cols and the last spans two rows.
2nd row = first 4 cols covered by above, then 3 cols, then covered by above, then 3 cols, then covered by above.

In essence Risk / Std / Full should line up under 'To be checked' and 'Actually checked', only they don't the second row starts aligned hard left under 'Firm' the first column?

What am I doing wrong?

Thanks,
1DMF


"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
 
Hi

I am afraid I do not understand you. You want this :
[pre]
┌──────┬─────────┬──────┬──────┬───────────────────┬───────┬───────────────────┬──────┐
│ │ │ │ │ To be checked │ │ Actually checked │ │
│ Firm │ Adviser │ Subs │ Sent ├──────┬─────┬──────┤ Check ├──────┬─────┬──────┤ Over │
│ │ │ │ │ Risk │ Std │ Full │ │ Risk │ Std │ Full │ │
└──────┴─────────┴──────┴──────┴──────┴─────┴──────┴───────┴──────┴─────┴──────┴──────┘
[/pre]

And the markup you posted does not render like above ?

Well, does for me. In Gecko, Presto, WebKit and Trident.

Are you sure the CSS does not change the [tt]display[/tt] of any of those elements ?


Feherke.
feherke.ga
 
That's exactly how it should look and does only in IE, looks like this in Opera, FF and Chrome...

┌──────┬─────────┬──────┬──────┬───────────────────┬───────┬───────────────────┬──────┐
│ Firm │ Adviser │ Subs │ Sent │ To be checked │ Check │ Actually checked │ Over │
|______|_________|______|______|___________________|_______|___________________|______|
│ Risk │ Std │ Full │ Risk │ Std │ Full│
└──────┴─────────┴──────┴──────┴──────┴─────┴

Yes all of them have display:inline-block;


"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
 
Hi

1DMF said:
Yes all of them have display:inline-block;
Just like [tt]width[/tt] has no effect on [tt]inline[/tt] elements, [tt]colspan[/tt] has no effect on anything else then [tt]table-cell[/tt] elements. Personally I do expect the browsers render them that way.


Feherke.
feherke.ga
 
Hi

1DMF said:
ok thanks, thought the 'block' bit resolved this. wrong again!
Sorry, I am not really fresh today. You mean that after applying CSS [tt]th { display: block }[/tt] the column spanning works again ?

Feherke.
feherke.ga
 
no; the 'block' part of inline-block.

I changed it to table-cell and it is spanning correctly.

Though lining up a table head with a table body to enable a fixed heading with an overflow scroll drives me nuts.

Why the hell you can't overflow-scroll a tbody is beyond me, leaving the thead part of the same table is beyond me.

Do you ever have those days where it feels like you've worked ya butt off but got nothing done?

"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
 
Hi

Oh, the scrolling table. Tried it some time ago. I managed to make two versions : one functional and one portable. Never succeeded in combining both features in one solution. :-(


Feherke.
feherke.ga
 
If you actually need a tabular layout to display tabular data why not just use a table?


It's not a mortal sin, neither and the style police can't charge you with anything.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
ChrisHirst said:
If you actually need a tabular layout to display tabular data why not just use a table?

He is using a table.

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top