HTML Table: How to resize data cells when already specified "colspan"?
Posted
by Jenny
on Stack Overflow
See other posts from Stack Overflow
or by Jenny
Published on 2010-06-02T18:48:38Z
Indexed on
2010/06/02
19:14 UTC
Read the original article
Hit count: 182
I have tabular data to display, which has a meaning to both rows and columns. Columns are time blocks, rows are days. A particular datacell is confined to a single day, but can be in multiple time block. To show this, I am using the colspan tag.
<div id = "GuideTable">
<table>
<tr>
<td colspan = 3>
</td></tr></table>
</div>
Or Whatever.
I'm trying to apply CSS formating to the entire table, and for changing colors, etc, things are fine, but wanting to have a consistent width is where I am running into problems.
Right now, each data cell's width seems tied to the maximum width in its column (everything auto lines up). Some columns are itty bitty, others are huge. I'm trying to make columns consistently sized (even if that means every column is as big as the biggest column needs to be), but setting an individual datacells width (either via css or in the tag itself) is getting me nowhere.
I'm thinking maybe the colspan tag is overriding my manual width? If that's the case, how can I change the width of a column as a whole, especially since they aren't explicitly defined? (CAN you explicitly define columns?)
Examples of the CSS I'm using:
#GuideTable td{
background:#ffffff;
border-style: solid;
border-width: 1px;
width: 100px;
}
© Stack Overflow or respective owner