Jump to content

"colspan" in css tables?


jayjay960

Recommended Posts

So, I need a table to look like this:

 

#############
#     #     #
#############
#     #     #
#############
#           #
#############

 

Now just using plain html, that would be easy enough to do, just adding colspan="2" to the last cell, however, I'm using css tables, as in, this is what my table looks like:

<style>
.table { display: table; }
.tr { display: table-row; }
.td { display: table-cell; }
</style>

<div class="table">
<div class="tr"><div class="td">Cell 1</div><div class="td">Cell 2</div></div>
<div class="tr"><div class="td">Cell 3</div><div class="td">Cell 4</div></div>
<div class="tr"><div class="td">Cell 5</div></div>
</div>

 

Now, what I want to know is if there is a CSS equivalent to colspan that lets one cell take up more room. I've tried just setting width: 100%;, and using the html colspan="2" but neither work. I have the CSS2 specification pdf which is helpful, but I haven't been able to find any answers in there. Can anyone help?

Link to comment
https://forums.phpfreaks.com/topic/167459-colspan-in-css-tables/
Share on other sites

  • 2 weeks later...

Please could someone have a look at this and advise re the colspan bit... is this allowed??

body {

font-family: Verdana, Arial, Helvetica, sans-serif;

}

h1 {

colour: #FF0000;/*red*/;

background-color: #3333;/*grey*/;

}

th, td, colspan {

border: 1et solid #666666;

}

 

p, li, dd, dt {

color: #000000;

background-color: #FFFFFF;

font-size: 1em;

font-style: normal;

}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.