问题
I created a page containing a table
and some data in it. Although I set table's width to 80% of it's parent div, the inner tbody
and other children's width is frozen to 450px.
I also noticed that once I removed the property display: block
, the table's children were correctly displayed (100% width of the table)
I there a particular reason for width to be frozen at 450px ? I checked everywhere in my CSS, and I did not set such a rule.
Here is the code of my table :
<div id="maincol">
<table width="80%" border="0" cellpadding="1" cellspacing="0" id="dates" class="summary" name="dates" style="display:block">
<tbody>
<tr>
...
回答1:
tables have their own display type: "table" (and it's the only one possible), similarly tr and td have respectively display "table-row" and "table-cell"
来源:https://stackoverflow.com/questions/7659087/tables-width-frozen-because-of-display-block