Set the table width in HTML and CSS
Description
The following code shows how to set the table width.
Example
<html>
<body>
<table border="1" width="500">
<caption>Classic Movie Day</caption>
<tr>
<th></th>
<th width="200">5 pm</th>
<th width="200">7 pm</th>
<th width="200">9 pm</th>
<th width="200">11 pm</th>
</tr><!-- w ww . j ava2 s . c o m-->
<tr>
<th>Screen one</th>
<td>HTML</td>
<td>Java</td>
<td>Javascript</td>
<td>CSS</td>
</tr>
<tr>
<th>Screen two</th>
<td colspan="2">Database</td>
<td colspan="2">Oracle</td>
</tr>
<tr>
<th>Screen three</th>
<td colspan="2">C#</td>
<td>HTML5</td>
<td>CSS3</td>
</tr>
</table>
</body>
</html>
The code above generates the following result.
...
Mix Auto-layout Table with Flex Columns in ...
Mix Column percentage and pixels width sett...
Mix Fixed Table with Flex Columns in HTML a...
Set Padding for table cell in HTML and CSS
Set background color for table header in HT...
Set background for column group in HTML and...
Set border bottom for table cell in HTML an...
Set border collapse for table in HTML and C...
Set border for table cell in HTML and CSS
Set border for table header in HTML and CSS
Set border for table in HTML and CSS
Set border left for table cell in HTML and ...
Set border right for table cell in HTML and...
Set border space for table in HTML and CSS
Set border-spacing for table in HTML and CS...
Set border top for table cell in HTML and C...
Set color for table cell in HTML and CSS
Set color for table header in HTML and CSS
Set font for table in HTML and CSS
Set font size for column group in HTML and ...
Set padding for table header in HTML and CS...
Set style for right bottom cell in HTML and...
Set style for top right table cell in HTML ...
Set style per table column in HTML and CSS
Set table border collapse to separate in HT...
Set table caption to bottom in HTML and CSS
Set table-layout to auto in HTML and CSS
Set table layout to fix and 100% width in H...
Set table layout to fix and 200-pixel width...
Set table layout to fixed in HTML and CSS
Set text align for table header in HTML and...
Set text alignment for table header in HTML...
Set text shadow for table cell in HTML and ...
Set text shadow for table header in HTML an...
Set the left and bottom cell style in HTML ...
Set top left table cell style in HTML and C...
...
Mix Auto-layout Table with Flex Columns in ...
Mix Column percentage and pixels width sett...
Mix Fixed Table with Flex Columns in HTML a...
Set Padding for table cell in HTML and CSS
Set background color for table header in HT...
Set background for column group in HTML and...
Set border bottom for table cell in HTML an...
Set border collapse for table in HTML and C...
Set border for table cell in HTML and CSS
Set border for table header in HTML and CSS
Set border for table in HTML and CSS
Set border left for table cell in HTML and ...
Set border right for table cell in HTML and...
Set border space for table in HTML and CSS
Set border-spacing for table in HTML and CS...
Set border top for table cell in HTML and C...
Set color for table cell in HTML and CSS
Set color for table header in HTML and CSS
Set font for table in HTML and CSS
Set font size for column group in HTML and ...
Set padding for table header in HTML and CS...
Set style for right bottom cell in HTML and...
Set style for top right table cell in HTML ...
Set style per table column in HTML and CSS
Set table border collapse to separate in HT...
Set table caption to bottom in HTML and CSS
Set table-layout to auto in HTML and CSS
Set table layout to fix and 100% width in H...
Set table layout to fix and 200-pixel width...
Set table layout to fixed in HTML and CSS
Set text align for table header in HTML and...
Set text alignment for table header in HTML...
Set text shadow for table cell in HTML and ...
Set text shadow for table header in HTML an...
Set the left and bottom cell style in HTML ...
Set the table width in HTML and CSS
Set to hide empty cell for table in HTML an...Set top left table cell style in HTML and C...
...