4

I'm trying to simulate html table element by using pure CSS (for latest Chrome). Here is the code: http://jsfiddle.net/XVecz/4/

.table .table-cell[colSpan] {
    width: 100%;
 }

All works fine except colSpan attribute. It doesn't fill td-cell. Can you advise any workaround?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Erik
  • 14,060
  • 49
  • 132
  • 218
  • 1
    There's nothing wrong with using a for tabular data.
    –  Jun 10 '13 at 13:15
  • Duplicate http://stackoverflow.com/questions/2403990/html-colspan-in-css, no? – maximkou Jun 10 '13 at 13:19
  • Nope. There are 2 tables. But I have the single. It's difference – Erik Jun 10 '13 at 13:21
  • @Llepwryd - The fiddle doesn't look like tabular data to me. – Alohci Jun 10 '13 at 13:21
  • @Erik, two tables? Not a 2 rows? – maximkou Jun 10 '13 at 13:22
  • It's just example of mu full source code. I need to get work colSpan – Erik Jun 10 '13 at 13:23
  • In the "Duplicate" question that you've provided explain about two tables – Erik Jun 10 '13 at 13:24
  • Erik. You won't get colspan to work with CSS tables. CSS just doesn't support it right now. But there may be a way to achieve the layout you want by other means, or it may be that an HTML table is more appropriate for what you are trying to do. You need to let us know more about what the information is that you are trying to convey. – Alohci Jun 10 '13 at 13:30

1 Answers1

2

unfortunately, y'ou'll need to breakup the layout. If you use sized cells alike, it can be okay. To break up the layout, you need to set table-rows as table. http://jsfiddle.net/XVecz/5/

.table .table-row {
    display: table;
    width:100%;
}
G-Cyrillus
  • 101,410
  • 14
  • 105
  • 129
  • Thanks. I think it will useful for me. May you help me with rowSpan? – Erik Jun 10 '13 at 13:35
  • you'll need to modify your markup for this. rowspan cannot be achieve. so you need to include your rowspan within the same cell alike.In other words, everything has to be in the same parent row – G-Cyrillus Jun 10 '13 at 13:47
  • May you provide an example? – Erik Jun 10 '13 at 14:20