Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jan 2006
    Location
    Cairo, Egypt
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question display: table-cell equivalent colspan

    Assume I have the following simple HTML:
    Code:
    <div id="Table" style="display: table;">
      <div id="Row1" style="display: table-row; height: 100px;">
        <div id="Cell1" style="display: table-cell; width: 50%;"></div>
        <div id="Cell2" style="display: table-cell; width: 50%;"></div>
      </div>
      <div id="Row2" style="display: table-row; height: 100px;">
        <div id="Cell3" style="display: table-cell;"></div>
      </div>
    </div>
    I need the equivalent of
    Code:
    colspan="2"
    on Cell3
    I mean that I need:
    Cell3 width = (Cell1 width + Cell2 width)
    Khaled Mahmoud
    Web, Flash, Games developer.
    JavaScript reference VBScript reference ASP reference

  • #2
    Regular Coder djh101's Avatar
    Join Date
    May 2009
    Location
    California
    Posts
    616
    Thanks
    48
    Thanked 65 Times in 65 Posts
    Why not just use a table...?
    "Yeah science!"
    Online Science Tools

  • #3
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,642
    Thanks
    6
    Thanked 1,005 Times in 978 Posts
    Or why not set cell3’s width to 100%?

  • #4
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    There is a column-span CSS3 property. But it is supported only by Opera (at least in theory) and Chrome (-webkit-column-span).

    Use a HTML table. Of use CSS float and clear instead of table-cell, table-row.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #5
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Quote Originally Posted by VIPStephan View Post
    Or why not set cell3’s width to 100%?
    It won't work. It will extend the first cell above, as well.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •