Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Different td widths in different rows in tables?

Tags:

html

css

xhtml

Quick-Question: how can this be achieved? (see image below)

crazytable

Setting td width booth in plain html and with css had no effect.

The td width CAN vary but only with the same width for each row.

like image 537
iceteea Avatar asked Dec 01 '11 12:12

iceteea


2 Answers

Use three separate <table> blocks, each with a single row having three columns of varying widths.

like image 150
Chris Fulstow Avatar answered Oct 20 '22 07:10

Chris Fulstow


I don't believe it can in one table easily.

Instead, you have to use the colspan attribute to overlap cells on different rows.

For example, use 6 columns, the first row will have colspan = 2 , td, colspan = 2

The second row will have td, td colspan=2, td and so on.

It's quite messy - you might want to consider displaying your data in a different way, for example, using DIVs

like image 37
dash Avatar answered Oct 20 '22 07:10

dash