Avatar billede htx98i17 Professor
23. januar 2007 - 17:30 Der er 11 kommentarer og
1 løsning

tabel rykker sig

Jeg har nedenstående tabeller: Kopiere ind i en html fil og se den i explorer.

Som man kan se rykker tabellen sig. Timerne passer ikke.
Det er nemmere at se hvis man lige fjerne den ene række og bagefter den anden, for så vises de enkeltvis korrekt.

Men hvorfor ikke når de begge er der?
Een column er eet kvarter og een column er 15 pixels
Tallene i parentes er det antal columns der er flettet i det felt

<table border="0" cellspacing="0" cellpadding="0" >
    <tr>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">07.00</td>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">8.00</td>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">9.00</td>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">10.00</td>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">11.00</td>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">12.00</td>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">13.00</td>
    </tr>
</table>
                   
<table cellspacing="0" cellpadding="0" >   
    <tr>
        <td class="main" width="240" colspan="16"  style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">(16)&nbsp;</td>
        <td class="main" width="180" colspan="12" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;background: #CCFFFF;">(12) 11:00 - 14:30</td>
    </tr>
    <tr>
        <td class="main" width="60" colspan="4"  style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">(4)&nbsp;</td>
        <td class="main" width="210" colspan="14" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;background: #CCFFFF;">(14) 08:00 - 11:30</td>
        <td class="main" width="150" colspan="10" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">(10)&nbsp;</td>
    </tr>                   
</table>
Avatar billede roenving Novice
23. januar 2007 - 17:35 #1
Hvorfor fjerner du ikke bare, at det skal være forskellige tabeller ?-)

-- altså fjern:

</table>
                   
<table cellspacing="0" cellpadding="0" >
Avatar billede roenving Novice
23. januar 2007 - 17:36 #2
-- forøvrigt er det en anelse bedre i FF, men stadig ikke godt, med een tabel, er browserne næsten helt enige !-)
Avatar billede htx98i17 Professor
23. januar 2007 - 17:39 #3
ja hvorfor var det nu jeg ikke gjorde det... synes der var et eller andet, men det kommer jeg nok i tanke om på et tidspunkt

men hvordan kan det være den opfører sig sådan når den er delt op i 2 tabeller?
Avatar billede roenving Novice
23. januar 2007 - 17:57 #4
Fordi browseren ikke stoler på, at du ved, hvad du gør, så den evaluerer på tekst-længder og stiller det op, som den synes !o]
Avatar billede htx98i17 Professor
23. januar 2007 - 17:59 #5
grr :-)

lig et svar
Avatar billede roenving Novice
23. januar 2007 - 18:02 #6
Oki '-)

-- dog foretrækker jeg at lægge et svar, jeg har ikke lyst til at ligge herinde !-)
Avatar billede htx98i17 Professor
23. januar 2007 - 18:12 #7
hehe :)
Avatar billede roenving Novice
23. januar 2007 - 18:13 #8
-- og tak for point ;~}
Avatar billede htx98i17 Professor
23. januar 2007 - 21:48 #9
hvorfor rykker denne her sig så...
den burde pege præcis på 14:30

<table border="0" cellspacing="0" cellpadding="0" >
        <tr>
            <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">07.00</td>
            <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">8.00</td>
            <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">9.00</td>
            <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">10.00</td>
            <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">11.00</td>
            <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">12.00</td>
            <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">13.00</td>
            <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">14.00</td>
        </tr>
        <tr>
            <td class="main" width="240" colspan="16"  style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">&nbsp;</td>
            <td class="main" width="210" colspan="14" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;background: #CCFFFF;">11:00 - 14:30</td>
            <td class="main" width="30" colspan="2" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">&nbsp;</td>
        </tr>
</table>
Avatar billede htx98i17 Professor
23. januar 2007 - 21:51 #10
hvis jeg tilføjer en ekstra time så den ser således ud, så passer den?
<table border="0" cellspacing="0" cellpadding="0" >
    <tr>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">07.00</td>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">8.00</td>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">9.00</td>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">10.00</td>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">11.00</td>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">12.00</td>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">13.00</td>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">14.00</td>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">15.00</td>
    </tr>
    <tr>
        <td class="main" width="240" colspan="16"  style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">&nbsp;</td>
        <td class="main" width="210" colspan="14" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;background: #CCFFFF;">11:00 - 14:30</td>
        <td class="main" width="90" colspan="6" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">&nbsp;</td>
    </tr>
</table>
Avatar billede htx98i17 Professor
23. januar 2007 - 21:53 #11
og igen
hvis man smider de to tabeller sammen i een, så passer det?
<table border="0" cellspacing="0" cellpadding="0" >
    <tr>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">07.00</td>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">8.00</td>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">9.00</td>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">10.00</td>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">11.00</td>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">12.00</td>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">13.00</td>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">14.00</td>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">15.00</td>
    </tr>
    <tr>
        <td class="main" width="240" colspan="16"  style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">&nbsp;</td>
        <td class="main" width="210" colspan="14" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;background: #CCFFFF;">11:00 - 14:30</td>
        <td class="main" width="90" colspan="6" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">&nbsp;</td>
    </tr>

    <tr>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">07.00</td>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">8.00</td>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">9.00</td>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">10.00</td>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">11.00</td>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">12.00</td>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">13.00</td>
        <td class="main" colspan="4" width="60" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">14.00</td>
    </tr>
    <tr>
        <td class="main" width="240" colspan="16"  style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">&nbsp;</td>
        <td class="main" width="210" colspan="14" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;background: #CCFFFF;">11:00 - 14:30</td>
        <td class="main" width="30" colspan="2" style="border-right: 1px SOLID #000000;border-bottom: 1px SOLID #000000;">&nbsp;</td>
    </tr>
</table>

Det er da helt vildt belastende, for der er ikke nogen fejl i antal cols der er flettet i forhold til width etc, vel?
Avatar billede htx98i17 Professor
23. januar 2007 - 22:21 #12
jeg har lyst det med
<tr>
                                                    <td class="main" width="15" >&nbsp;</td>
                                                    <td class="main" width="15" >&nbsp;</td>
                                                    <td class="main" width="15" >&nbsp;</td>
                                                    <td class="main" width="15" >&nbsp;</td>
                                                    <td class="main" width="15" >&nbsp;</td>
                                                    <td class="main" width="15" >&nbsp;</td>
                                                    <td class="main" width="15" >&nbsp;</td>
                                                    <td class="main" width="15" >&nbsp;</td>
                                                    <td class="main" width="15" >&nbsp;</td>
                                                    <td class="main" width="15" >&nbsp;</td>
                                                    <td class="main" width="15" >&nbsp;</td>
                                                    <td class="main" width="15" >&nbsp;</td>
                                                    <td class="main" width="15" >&nbsp;</td>
                                                    <td class="main" width="15" >&nbsp;</td>
                                                    <td class="main" width="15" >&nbsp;</td>
                                                    <td class="main" width="15" >&nbsp;</td>
                                                    <td class="main" width="15" >&nbsp;</td>
                                                    <td class="main" width="15" >&nbsp;</td>
                                                    <td class="main" width="15" >&nbsp;</td>
                                                    <td class="main" width="15" >&nbsp;</td>
                                                    <td class="main" width="15" >&nbsp;</td>
                                                    <td class="main" width="15" >&nbsp;</td>
                                                    <td class="main" width="15" >&nbsp;</td>
                                                    <td class="main" width="15" >&nbsp;</td>
                                                    <td class="main" width="15" >&nbsp;</td>
                                                    <td class="main" width="15" >&nbsp;</td>
                                                    <td class="main" width="15" >&nbsp;</td>
                                                    <td class="main" width="15" >&nbsp;</td>
                                                    <td class="main" width="15" >&nbsp;</td>
                                                    <td class="main" width="15" >&nbsp;</td>
                                                    <td class="main" width="15" >&nbsp;</td>
                                                    <td class="main" width="15" >&nbsp;</td>
                                                </tr>

der så holder kolonnerne i den rette bredde. Men det er stadig skod, nu når der ikke er fejl i width alle flettet colomns
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester