HTML embed table into a table row (using div tables)





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







1















What I'm trying to do:



GOAL



Notice there is an embedded table under that is in the place of the new row.
The idea is this would be a dropdown for a single row, upon dropping down, it would reveal a subtable. There would be existing rows under the dropdown table.



What is actually happening:



REALITY



The embedded table only seems to span across the first column, but I need it to fit the width of the entire row. I originally was using HTML <table> tags but tried switching to the divTable format. Unfortunately, this didn't work either.



What am I doing wrong here?



My html:



<div class="divTable">
<div class="divTableHeading">
<div class="divTableRow">
<div class="divTableHead">head1</div>
<div class="divTableHead">head2</div>
<div class="divTableHead">head3</div>
<div class="divTableHead">head4</div>
<div class="divTableHead">head5</div>
<div class="divTableHead">head6</div>
<div class="divTableHead">head7</div>
</div>
</div>
<div class="divTableBody">
<div class="divTableRow">
<div class="divTableCell">cell1</div>
<div class="divTableCell">cell2</div>
<div class="divTableCell">c3</div>
<div class="divTableCell">c4</div>
<div class="divTableCell">c5</div>
<div class="divTableCell">-c6</div>
<div class="divTableCell">c7</div>
</div>
<div class="divTableRow">
<div class="divTable">
<div class="divTableHeading">
<div class="divTableRow">
<div class="divTableHead">embedded1</div>
<div class="divTableHead">embedded2</div>
<div class="divTableHead">embedded3</div>
</div>
</div>
<div class="divTableBody">
<div class="divTableRow dropdownTable">
<div class="divTableCell">1</div>
<div class="divTableCell">2</div>
<div class="divTableCell">3</div>
</div>
<div class="divTableRow dropdownTable">
<div class="divTableCell">1</div>
<div class="divTableCell">2</div>
<div class="divTableCell">3</div>
</div>
</div>
</div>
</div>

</div>
</div>


My CSS:



.divTable{
display: table;
width: 100%;
width: 100%;
border: 1px solid #eeeeeea8;
-webkit-box-shadow: 6px 9px 33px -5px rgba(0,0,0,0.75);
-moz-box-shadow: 6px 9px 33px -5px rgba(0,0,0,0.75);
box-shadow: 6px 9px 33px -5px rgba(0,0,0,0.75);
border-radius: 10px 10px 10px 10px;
-moz-border-radius: 10px 10px 10px 10px;
-webkit-border-radius: 10px 10px 10px 10px;
}

.divTableRow {
display: table-row;
}
.divTableHeading {
background-color: #EEE;
display: table-header-group;
}
.divTableCell, .divTableHead {
border: 1px solid #999999;
display: table-cell;
padding: 3px 10px;
}
.divTableHeading {
background-color: #EEE;
display: table-header-group;
font-weight: bold;
}
.divTableFoot {
background-color: #EEE;
display: table-footer-group;
font-weight: bold;
}
.divTableBody {
display: table-row-group;
}

.divTableRow:nth-child(even){
background-color: #f2f2f2;
}
.divTableRow:hover:not(:first-child) {
background-color: #ddd;
}
.divTableCell, .divTableHead{
border: 1px solid rgba(221, 221, 221, 0.836);
padding: 8px;
}
.divTableHead{
padding-top: 12px;
padding-bottom: 12px;
text-align: center;
background-color: rgba(251, 38, 0,.9);
color: white;
}









share|improve this question

























  • stackoverflow.com/questions/9277661/… try this code

    – ma_dev_15
    Jan 4 at 18:34


















1















What I'm trying to do:



GOAL



Notice there is an embedded table under that is in the place of the new row.
The idea is this would be a dropdown for a single row, upon dropping down, it would reveal a subtable. There would be existing rows under the dropdown table.



What is actually happening:



REALITY



The embedded table only seems to span across the first column, but I need it to fit the width of the entire row. I originally was using HTML <table> tags but tried switching to the divTable format. Unfortunately, this didn't work either.



What am I doing wrong here?



My html:



<div class="divTable">
<div class="divTableHeading">
<div class="divTableRow">
<div class="divTableHead">head1</div>
<div class="divTableHead">head2</div>
<div class="divTableHead">head3</div>
<div class="divTableHead">head4</div>
<div class="divTableHead">head5</div>
<div class="divTableHead">head6</div>
<div class="divTableHead">head7</div>
</div>
</div>
<div class="divTableBody">
<div class="divTableRow">
<div class="divTableCell">cell1</div>
<div class="divTableCell">cell2</div>
<div class="divTableCell">c3</div>
<div class="divTableCell">c4</div>
<div class="divTableCell">c5</div>
<div class="divTableCell">-c6</div>
<div class="divTableCell">c7</div>
</div>
<div class="divTableRow">
<div class="divTable">
<div class="divTableHeading">
<div class="divTableRow">
<div class="divTableHead">embedded1</div>
<div class="divTableHead">embedded2</div>
<div class="divTableHead">embedded3</div>
</div>
</div>
<div class="divTableBody">
<div class="divTableRow dropdownTable">
<div class="divTableCell">1</div>
<div class="divTableCell">2</div>
<div class="divTableCell">3</div>
</div>
<div class="divTableRow dropdownTable">
<div class="divTableCell">1</div>
<div class="divTableCell">2</div>
<div class="divTableCell">3</div>
</div>
</div>
</div>
</div>

</div>
</div>


My CSS:



.divTable{
display: table;
width: 100%;
width: 100%;
border: 1px solid #eeeeeea8;
-webkit-box-shadow: 6px 9px 33px -5px rgba(0,0,0,0.75);
-moz-box-shadow: 6px 9px 33px -5px rgba(0,0,0,0.75);
box-shadow: 6px 9px 33px -5px rgba(0,0,0,0.75);
border-radius: 10px 10px 10px 10px;
-moz-border-radius: 10px 10px 10px 10px;
-webkit-border-radius: 10px 10px 10px 10px;
}

.divTableRow {
display: table-row;
}
.divTableHeading {
background-color: #EEE;
display: table-header-group;
}
.divTableCell, .divTableHead {
border: 1px solid #999999;
display: table-cell;
padding: 3px 10px;
}
.divTableHeading {
background-color: #EEE;
display: table-header-group;
font-weight: bold;
}
.divTableFoot {
background-color: #EEE;
display: table-footer-group;
font-weight: bold;
}
.divTableBody {
display: table-row-group;
}

.divTableRow:nth-child(even){
background-color: #f2f2f2;
}
.divTableRow:hover:not(:first-child) {
background-color: #ddd;
}
.divTableCell, .divTableHead{
border: 1px solid rgba(221, 221, 221, 0.836);
padding: 8px;
}
.divTableHead{
padding-top: 12px;
padding-bottom: 12px;
text-align: center;
background-color: rgba(251, 38, 0,.9);
color: white;
}









share|improve this question

























  • stackoverflow.com/questions/9277661/… try this code

    – ma_dev_15
    Jan 4 at 18:34














1












1








1








What I'm trying to do:



GOAL



Notice there is an embedded table under that is in the place of the new row.
The idea is this would be a dropdown for a single row, upon dropping down, it would reveal a subtable. There would be existing rows under the dropdown table.



What is actually happening:



REALITY



The embedded table only seems to span across the first column, but I need it to fit the width of the entire row. I originally was using HTML <table> tags but tried switching to the divTable format. Unfortunately, this didn't work either.



What am I doing wrong here?



My html:



<div class="divTable">
<div class="divTableHeading">
<div class="divTableRow">
<div class="divTableHead">head1</div>
<div class="divTableHead">head2</div>
<div class="divTableHead">head3</div>
<div class="divTableHead">head4</div>
<div class="divTableHead">head5</div>
<div class="divTableHead">head6</div>
<div class="divTableHead">head7</div>
</div>
</div>
<div class="divTableBody">
<div class="divTableRow">
<div class="divTableCell">cell1</div>
<div class="divTableCell">cell2</div>
<div class="divTableCell">c3</div>
<div class="divTableCell">c4</div>
<div class="divTableCell">c5</div>
<div class="divTableCell">-c6</div>
<div class="divTableCell">c7</div>
</div>
<div class="divTableRow">
<div class="divTable">
<div class="divTableHeading">
<div class="divTableRow">
<div class="divTableHead">embedded1</div>
<div class="divTableHead">embedded2</div>
<div class="divTableHead">embedded3</div>
</div>
</div>
<div class="divTableBody">
<div class="divTableRow dropdownTable">
<div class="divTableCell">1</div>
<div class="divTableCell">2</div>
<div class="divTableCell">3</div>
</div>
<div class="divTableRow dropdownTable">
<div class="divTableCell">1</div>
<div class="divTableCell">2</div>
<div class="divTableCell">3</div>
</div>
</div>
</div>
</div>

</div>
</div>


My CSS:



.divTable{
display: table;
width: 100%;
width: 100%;
border: 1px solid #eeeeeea8;
-webkit-box-shadow: 6px 9px 33px -5px rgba(0,0,0,0.75);
-moz-box-shadow: 6px 9px 33px -5px rgba(0,0,0,0.75);
box-shadow: 6px 9px 33px -5px rgba(0,0,0,0.75);
border-radius: 10px 10px 10px 10px;
-moz-border-radius: 10px 10px 10px 10px;
-webkit-border-radius: 10px 10px 10px 10px;
}

.divTableRow {
display: table-row;
}
.divTableHeading {
background-color: #EEE;
display: table-header-group;
}
.divTableCell, .divTableHead {
border: 1px solid #999999;
display: table-cell;
padding: 3px 10px;
}
.divTableHeading {
background-color: #EEE;
display: table-header-group;
font-weight: bold;
}
.divTableFoot {
background-color: #EEE;
display: table-footer-group;
font-weight: bold;
}
.divTableBody {
display: table-row-group;
}

.divTableRow:nth-child(even){
background-color: #f2f2f2;
}
.divTableRow:hover:not(:first-child) {
background-color: #ddd;
}
.divTableCell, .divTableHead{
border: 1px solid rgba(221, 221, 221, 0.836);
padding: 8px;
}
.divTableHead{
padding-top: 12px;
padding-bottom: 12px;
text-align: center;
background-color: rgba(251, 38, 0,.9);
color: white;
}









share|improve this question
















What I'm trying to do:



GOAL



Notice there is an embedded table under that is in the place of the new row.
The idea is this would be a dropdown for a single row, upon dropping down, it would reveal a subtable. There would be existing rows under the dropdown table.



What is actually happening:



REALITY



The embedded table only seems to span across the first column, but I need it to fit the width of the entire row. I originally was using HTML <table> tags but tried switching to the divTable format. Unfortunately, this didn't work either.



What am I doing wrong here?



My html:



<div class="divTable">
<div class="divTableHeading">
<div class="divTableRow">
<div class="divTableHead">head1</div>
<div class="divTableHead">head2</div>
<div class="divTableHead">head3</div>
<div class="divTableHead">head4</div>
<div class="divTableHead">head5</div>
<div class="divTableHead">head6</div>
<div class="divTableHead">head7</div>
</div>
</div>
<div class="divTableBody">
<div class="divTableRow">
<div class="divTableCell">cell1</div>
<div class="divTableCell">cell2</div>
<div class="divTableCell">c3</div>
<div class="divTableCell">c4</div>
<div class="divTableCell">c5</div>
<div class="divTableCell">-c6</div>
<div class="divTableCell">c7</div>
</div>
<div class="divTableRow">
<div class="divTable">
<div class="divTableHeading">
<div class="divTableRow">
<div class="divTableHead">embedded1</div>
<div class="divTableHead">embedded2</div>
<div class="divTableHead">embedded3</div>
</div>
</div>
<div class="divTableBody">
<div class="divTableRow dropdownTable">
<div class="divTableCell">1</div>
<div class="divTableCell">2</div>
<div class="divTableCell">3</div>
</div>
<div class="divTableRow dropdownTable">
<div class="divTableCell">1</div>
<div class="divTableCell">2</div>
<div class="divTableCell">3</div>
</div>
</div>
</div>
</div>

</div>
</div>


My CSS:



.divTable{
display: table;
width: 100%;
width: 100%;
border: 1px solid #eeeeeea8;
-webkit-box-shadow: 6px 9px 33px -5px rgba(0,0,0,0.75);
-moz-box-shadow: 6px 9px 33px -5px rgba(0,0,0,0.75);
box-shadow: 6px 9px 33px -5px rgba(0,0,0,0.75);
border-radius: 10px 10px 10px 10px;
-moz-border-radius: 10px 10px 10px 10px;
-webkit-border-radius: 10px 10px 10px 10px;
}

.divTableRow {
display: table-row;
}
.divTableHeading {
background-color: #EEE;
display: table-header-group;
}
.divTableCell, .divTableHead {
border: 1px solid #999999;
display: table-cell;
padding: 3px 10px;
}
.divTableHeading {
background-color: #EEE;
display: table-header-group;
font-weight: bold;
}
.divTableFoot {
background-color: #EEE;
display: table-footer-group;
font-weight: bold;
}
.divTableBody {
display: table-row-group;
}

.divTableRow:nth-child(even){
background-color: #f2f2f2;
}
.divTableRow:hover:not(:first-child) {
background-color: #ddd;
}
.divTableCell, .divTableHead{
border: 1px solid rgba(221, 221, 221, 0.836);
padding: 8px;
}
.divTableHead{
padding-top: 12px;
padding-bottom: 12px;
text-align: center;
background-color: rgba(251, 38, 0,.9);
color: white;
}






html css html5 html-table css-tables






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 8 at 8:49









Brian Tompsett - 汤莱恩

4,2671339104




4,2671339104










asked Jan 4 at 18:04









Alexander GonzalezAlexander Gonzalez

184




184













  • stackoverflow.com/questions/9277661/… try this code

    – ma_dev_15
    Jan 4 at 18:34



















  • stackoverflow.com/questions/9277661/… try this code

    – ma_dev_15
    Jan 4 at 18:34

















stackoverflow.com/questions/9277661/… try this code

– ma_dev_15
Jan 4 at 18:34





stackoverflow.com/questions/9277661/… try this code

– ma_dev_15
Jan 4 at 18:34












1 Answer
1






active

oldest

votes


















0














I will give you a suggestion that I had give to myself. Unless you are developing to some old-browsers as IE11 or similar, you could use Grid CSS to build such elaborated organization without lost yourself and others in this code abyss. As you can see in Grid CSS you can have more control about how rows and columns it will behave, you can even build your application to better behave in different screens sizes (as mobile or big ones). You have almost limitless options to work with it, as your front-end code will be more fast and improve better then just use these div but like table.



I wish that could help in your path.






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',
    autoActivateHeartbeat: false,
    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%2f54043990%2fhtml-embed-table-into-a-table-row-using-div-tables%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









    0














    I will give you a suggestion that I had give to myself. Unless you are developing to some old-browsers as IE11 or similar, you could use Grid CSS to build such elaborated organization without lost yourself and others in this code abyss. As you can see in Grid CSS you can have more control about how rows and columns it will behave, you can even build your application to better behave in different screens sizes (as mobile or big ones). You have almost limitless options to work with it, as your front-end code will be more fast and improve better then just use these div but like table.



    I wish that could help in your path.






    share|improve this answer




























      0














      I will give you a suggestion that I had give to myself. Unless you are developing to some old-browsers as IE11 or similar, you could use Grid CSS to build such elaborated organization without lost yourself and others in this code abyss. As you can see in Grid CSS you can have more control about how rows and columns it will behave, you can even build your application to better behave in different screens sizes (as mobile or big ones). You have almost limitless options to work with it, as your front-end code will be more fast and improve better then just use these div but like table.



      I wish that could help in your path.






      share|improve this answer


























        0












        0








        0







        I will give you a suggestion that I had give to myself. Unless you are developing to some old-browsers as IE11 or similar, you could use Grid CSS to build such elaborated organization without lost yourself and others in this code abyss. As you can see in Grid CSS you can have more control about how rows and columns it will behave, you can even build your application to better behave in different screens sizes (as mobile or big ones). You have almost limitless options to work with it, as your front-end code will be more fast and improve better then just use these div but like table.



        I wish that could help in your path.






        share|improve this answer













        I will give you a suggestion that I had give to myself. Unless you are developing to some old-browsers as IE11 or similar, you could use Grid CSS to build such elaborated organization without lost yourself and others in this code abyss. As you can see in Grid CSS you can have more control about how rows and columns it will behave, you can even build your application to better behave in different screens sizes (as mobile or big ones). You have almost limitless options to work with it, as your front-end code will be more fast and improve better then just use these div but like table.



        I wish that could help in your path.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 4 at 18:20









        Wesley MagalhãesWesley Magalhães

        394




        394
































            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.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54043990%2fhtml-embed-table-into-a-table-row-using-div-tables%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

            Monofisismo

            Angular Downloading a file using contenturl with Basic Authentication

            Olmecas