Validator gives table errors









up vote
-1
down vote

favorite












I have to make a table like



this



and I have this code so far:






 table, td, tr 
border: 1px solid black;

td
width: 50px;
height: 50px;

td[rowspan="2"]
height: 100px;

td[colspan="2"]
width: 100px;

<div>
<table>
<tr>
<td>a</td>
<td colspan="2">b</td>
</tr>
<tr>
<td rowspan="2">c</td>
<td colspan="2" rowspan="2">
<table>
<tr>
<td colspan="2" rowspan="2">d</td>
</tr>
<tr></tr>
</table>
</td>
</tr>
<tr></tr>
</table>
</div>





The validator is giving me



errors



and I don't know how to fix them.



I need no errors from the validator, as
it has to be acceptable by specification.










share|improve this question























  • Do not post images of code or errors! Images and screenshots can be a nice addition to a post, but please make sure the post is still clear and useful without them. If you post images of code or error messages make sure you also copy and paste or type the actual code/message into the post directly.
    – Rob
    Nov 10 at 13:52














up vote
-1
down vote

favorite












I have to make a table like



this



and I have this code so far:






 table, td, tr 
border: 1px solid black;

td
width: 50px;
height: 50px;

td[rowspan="2"]
height: 100px;

td[colspan="2"]
width: 100px;

<div>
<table>
<tr>
<td>a</td>
<td colspan="2">b</td>
</tr>
<tr>
<td rowspan="2">c</td>
<td colspan="2" rowspan="2">
<table>
<tr>
<td colspan="2" rowspan="2">d</td>
</tr>
<tr></tr>
</table>
</td>
</tr>
<tr></tr>
</table>
</div>





The validator is giving me



errors



and I don't know how to fix them.



I need no errors from the validator, as
it has to be acceptable by specification.










share|improve this question























  • Do not post images of code or errors! Images and screenshots can be a nice addition to a post, but please make sure the post is still clear and useful without them. If you post images of code or error messages make sure you also copy and paste or type the actual code/message into the post directly.
    – Rob
    Nov 10 at 13:52












up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











I have to make a table like



this



and I have this code so far:






 table, td, tr 
border: 1px solid black;

td
width: 50px;
height: 50px;

td[rowspan="2"]
height: 100px;

td[colspan="2"]
width: 100px;

<div>
<table>
<tr>
<td>a</td>
<td colspan="2">b</td>
</tr>
<tr>
<td rowspan="2">c</td>
<td colspan="2" rowspan="2">
<table>
<tr>
<td colspan="2" rowspan="2">d</td>
</tr>
<tr></tr>
</table>
</td>
</tr>
<tr></tr>
</table>
</div>





The validator is giving me



errors



and I don't know how to fix them.



I need no errors from the validator, as
it has to be acceptable by specification.










share|improve this question















I have to make a table like



this



and I have this code so far:






 table, td, tr 
border: 1px solid black;

td
width: 50px;
height: 50px;

td[rowspan="2"]
height: 100px;

td[colspan="2"]
width: 100px;

<div>
<table>
<tr>
<td>a</td>
<td colspan="2">b</td>
</tr>
<tr>
<td rowspan="2">c</td>
<td colspan="2" rowspan="2">
<table>
<tr>
<td colspan="2" rowspan="2">d</td>
</tr>
<tr></tr>
</table>
</td>
</tr>
<tr></tr>
</table>
</div>





The validator is giving me



errors



and I don't know how to fix them.



I need no errors from the validator, as
it has to be acceptable by specification.






 table, td, tr 
border: 1px solid black;

td
width: 50px;
height: 50px;

td[rowspan="2"]
height: 100px;

td[colspan="2"]
width: 100px;

<div>
<table>
<tr>
<td>a</td>
<td colspan="2">b</td>
</tr>
<tr>
<td rowspan="2">c</td>
<td colspan="2" rowspan="2">
<table>
<tr>
<td colspan="2" rowspan="2">d</td>
</tr>
<tr></tr>
</table>
</td>
</tr>
<tr></tr>
</table>
</div>





 table, td, tr 
border: 1px solid black;

td
width: 50px;
height: 50px;

td[rowspan="2"]
height: 100px;

td[colspan="2"]
width: 100px;

<div>
<table>
<tr>
<td>a</td>
<td colspan="2">b</td>
</tr>
<tr>
<td rowspan="2">c</td>
<td colspan="2" rowspan="2">
<table>
<tr>
<td colspan="2" rowspan="2">d</td>
</tr>
<tr></tr>
</table>
</td>
</tr>
<tr></tr>
</table>
</div>






html validation html-table






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 10 at 14:20









BoltClock

512k12711481190




512k12711481190










asked Nov 10 at 13:02









Mateusz Świątek

11




11











  • Do not post images of code or errors! Images and screenshots can be a nice addition to a post, but please make sure the post is still clear and useful without them. If you post images of code or error messages make sure you also copy and paste or type the actual code/message into the post directly.
    – Rob
    Nov 10 at 13:52
















  • Do not post images of code or errors! Images and screenshots can be a nice addition to a post, but please make sure the post is still clear and useful without them. If you post images of code or error messages make sure you also copy and paste or type the actual code/message into the post directly.
    – Rob
    Nov 10 at 13:52















Do not post images of code or errors! Images and screenshots can be a nice addition to a post, but please make sure the post is still clear and useful without them. If you post images of code or error messages make sure you also copy and paste or type the actual code/message into the post directly.
– Rob
Nov 10 at 13:52




Do not post images of code or errors! Images and screenshots can be a nice addition to a post, but please make sure the post is still clear and useful without them. If you post images of code or error messages make sure you also copy and paste or type the actual code/message into the post directly.
– Rob
Nov 10 at 13:52












1 Answer
1






active

oldest

votes

















up vote
0
down vote













rowspans and colspans are only used if a cell should span 2 other cells horizontally or vertically, which isn't the case in your example. They are not there to define width or height.



So delete those and use classes instead to define the properties you want:



Apart from that, delete those empty tr elements you have in there - they make no sense without tds in them. ALso the nested table with only one cell in it is rather strange (you could just fill that cell with content), but maybe there's a reason for that which you didn't tell us.






table, td, tr 
border: 1px solid black;

td
width: 50px;
height: 50px;

td.b
height: 100px;

td.a
width: 100px;

<div>
<table>
<tr>
<td>a</td>
<td class="a">b</td>
</tr>
<tr>
<td class="b">c</td>
<td class="a b" >
<table>
<tr>
<td class="a b">d</td>
</tr>
</table>
</td>
</tr>
</table>
</div>








share|improve this answer




















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53239219%2fvalidator-gives-table-errors%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    rowspans and colspans are only used if a cell should span 2 other cells horizontally or vertically, which isn't the case in your example. They are not there to define width or height.



    So delete those and use classes instead to define the properties you want:



    Apart from that, delete those empty tr elements you have in there - they make no sense without tds in them. ALso the nested table with only one cell in it is rather strange (you could just fill that cell with content), but maybe there's a reason for that which you didn't tell us.






    table, td, tr 
    border: 1px solid black;

    td
    width: 50px;
    height: 50px;

    td.b
    height: 100px;

    td.a
    width: 100px;

    <div>
    <table>
    <tr>
    <td>a</td>
    <td class="a">b</td>
    </tr>
    <tr>
    <td class="b">c</td>
    <td class="a b" >
    <table>
    <tr>
    <td class="a b">d</td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </div>








    share|improve this answer
























      up vote
      0
      down vote













      rowspans and colspans are only used if a cell should span 2 other cells horizontally or vertically, which isn't the case in your example. They are not there to define width or height.



      So delete those and use classes instead to define the properties you want:



      Apart from that, delete those empty tr elements you have in there - they make no sense without tds in them. ALso the nested table with only one cell in it is rather strange (you could just fill that cell with content), but maybe there's a reason for that which you didn't tell us.






      table, td, tr 
      border: 1px solid black;

      td
      width: 50px;
      height: 50px;

      td.b
      height: 100px;

      td.a
      width: 100px;

      <div>
      <table>
      <tr>
      <td>a</td>
      <td class="a">b</td>
      </tr>
      <tr>
      <td class="b">c</td>
      <td class="a b" >
      <table>
      <tr>
      <td class="a b">d</td>
      </tr>
      </table>
      </td>
      </tr>
      </table>
      </div>








      share|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        rowspans and colspans are only used if a cell should span 2 other cells horizontally or vertically, which isn't the case in your example. They are not there to define width or height.



        So delete those and use classes instead to define the properties you want:



        Apart from that, delete those empty tr elements you have in there - they make no sense without tds in them. ALso the nested table with only one cell in it is rather strange (you could just fill that cell with content), but maybe there's a reason for that which you didn't tell us.






        table, td, tr 
        border: 1px solid black;

        td
        width: 50px;
        height: 50px;

        td.b
        height: 100px;

        td.a
        width: 100px;

        <div>
        <table>
        <tr>
        <td>a</td>
        <td class="a">b</td>
        </tr>
        <tr>
        <td class="b">c</td>
        <td class="a b" >
        <table>
        <tr>
        <td class="a b">d</td>
        </tr>
        </table>
        </td>
        </tr>
        </table>
        </div>








        share|improve this answer












        rowspans and colspans are only used if a cell should span 2 other cells horizontally or vertically, which isn't the case in your example. They are not there to define width or height.



        So delete those and use classes instead to define the properties you want:



        Apart from that, delete those empty tr elements you have in there - they make no sense without tds in them. ALso the nested table with only one cell in it is rather strange (you could just fill that cell with content), but maybe there's a reason for that which you didn't tell us.






        table, td, tr 
        border: 1px solid black;

        td
        width: 50px;
        height: 50px;

        td.b
        height: 100px;

        td.a
        width: 100px;

        <div>
        <table>
        <tr>
        <td>a</td>
        <td class="a">b</td>
        </tr>
        <tr>
        <td class="b">c</td>
        <td class="a b" >
        <table>
        <tr>
        <td class="a b">d</td>
        </tr>
        </table>
        </td>
        </tr>
        </table>
        </div>








        table, td, tr 
        border: 1px solid black;

        td
        width: 50px;
        height: 50px;

        td.b
        height: 100px;

        td.a
        width: 100px;

        <div>
        <table>
        <tr>
        <td>a</td>
        <td class="a">b</td>
        </tr>
        <tr>
        <td class="b">c</td>
        <td class="a b" >
        <table>
        <tr>
        <td class="a b">d</td>
        </tr>
        </table>
        </td>
        </tr>
        </table>
        </div>





        table, td, tr 
        border: 1px solid black;

        td
        width: 50px;
        height: 50px;

        td.b
        height: 100px;

        td.a
        width: 100px;

        <div>
        <table>
        <tr>
        <td>a</td>
        <td class="a">b</td>
        </tr>
        <tr>
        <td class="b">c</td>
        <td class="a b" >
        <table>
        <tr>
        <td class="a b">d</td>
        </tr>
        </table>
        </td>
        </tr>
        </table>
        </div>






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 10 at 14:12









        Johannes

        36.3k102866




        36.3k102866



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53239219%2fvalidator-gives-table-errors%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Use pre created SQLite database for Android project in kotlin

            Darth Vader #20

            Ondo