I\'m trying to create a page with a number of static html tables on them.
What do I need to do to get them to display each column the same size as each other column
You can use CSS. One way is to set table-layout to fixed
, which stops the table and it's children from sizing according to their content. You can then set a fixed width on the relevant td
elements. This should do the trick:
table.PerformanceTable {
table-layout: fixed;
width: 500px;
}
table.PerformanceTable td.PerformanceCell {
width: 75px;
}
Suggestions for for tidying up? You don't need the cellpadding
or cellspacing
attributes, or the TableRow
and TableHeader
classes. You can cover those off in CSS:
table {
/* cellspacing */
border-collapse: collapse;
border-spacing: 0;
}
th {
/* This covers the th elements */
}
tr {
/* This covers the tr elements */
}
th, td {
/* cellpadding */
padding: 0;
}
You should use a heading (e.g. ) instead of
and a
or a table
instead of the Source . You wouldn't need the
elements either, because you'd be using proper block level elements.